create_hpc_bat.lsf 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. redrawoff;
  2. status = layoutmode;
  3. slash = "/";
  4. if (operatingsystem == "windows") {slash = "\\";}
  5. curdir = pwd;
  6. ######################################################
  7. # Get local hostname
  8. #
  9. ######################################################
  10. if (fileexists("temppath.txt")) {
  11. temppath = read("temppath.txt");
  12. len = length(temppath);
  13. temppath = substring(temppath,1,len-2);
  14. cd(temppath);
  15. if (fileexists("hostname.txt")) {
  16. hostname = read("hostname.txt");
  17. len = length(hostname);
  18. hostname = substring(hostname,1,len-2);
  19. cd(curdir);
  20. } else {
  21. cd(curdir);
  22. break;
  23. }
  24. } else {
  25. break;
  26. }
  27. ######################################################
  28. files = splitstring(dir,endl);
  29. isCreated = false;
  30. fname = curdir+slash+hostname+"exec.bat";
  31. if (fileexists(fname)){rm(fname);}
  32. for(i=1:length(files)) {
  33. file_to_check = files{i};
  34. ?file_to_check+" --"+num2str(length(file_to_check))+"ext: "+fileextension(file_to_check);
  35. if(fileextension(file_to_check) == "") {?"!!!!!! dir";}
  36. hpc_file_check; # uses variables: file_to_check, fname
  37. }
  38. write(fname,"exit /b 0");
  39. cd(curdir);
  40. redrawon;