JSL how to delete folders based on LastModificationDateHi, using JMP Pro 13.0. I am a JSL newbie so I know my coding isn't super efficient but I just need functionality for some personal scripts. I have a lenghtly script and in this one part I'm in need of copying a directory from another drive to a local work drive. First I purge the local work drive then do the copy. I don't want to copy the entire directory, just folders within that are -N days old. Is this possible? And "DirA" and "DirB" of course are substitutes for my drive locations.
SPath = "DirA";
LPath = "DirB";
LSubPath = "DirB"||"\DirC";
Delete Directory( LSubPath );
//Below is where I would like to only copy folders within SPath that are -N days old
Copy Directory (SPath, LPath);
Re: JSL how to delete folders based on LastModificationDatenamesdefaulttohere(1);
filelist=filesindirectory("DirA");
for(i=1,i );
);That worked, I made one tiny change at the end...seems I have to specify the file name in DirB in the copyfile function.
Thanks!!
Re: JSL how to delete folders based on LastModificationDateCan you copy files based on their creation date? This might be too slow as for only a few thousand files it took ~30s to generate a list (not copy).
Something like below:
namesdefaulttohere(1);
filelist=filesindirectory("DirA");
for(i=1,i<length(filelist),i++,
if(datedifference(creationdate("DirA\"||filelist[i]),today(),"Day","fractional")<10,
copyfile("DirA\"||filelist[i],"DirB")
);
);