Just fyi, Copy File() does not appear to overwrite. If the destination file already exists the log will show a zero instead. There also does not appear to be any switch possible (e.g. 1 = overwrite, 0 = no overwrite).
So I'm resorting to: Delete File() then Copy File() for cases where I want it to overwrite an existing destination file.
Just passing this along in case it help others. I do appreciate these relatively new file utilities, they come in handy for sure. DJ
text = "test" || char(i);
save text file("C:\TEMP\test.txt", text);
copy = copy file("C:\TEMP\test.txt", "C:\TEMP\test2.txt");
text2 = load text file("C:\TEMP\test.txt");
text3 = load text file("C:\TEMP\test2.txt");
I'm just bumping this up in case there's a solution. Problem is, having to Delete File () prior to Copy File () can take a long time...in my case 10 sec and that's for a very small file size.
If anyone knows any tricks to make Copy File () overwrite a file if it exists, let me know! thanks, DJ
The save file functions do overwrite provided the target file is not being accessed by another program. Would a read file/write file JSL script allow your to overcome the current limitations of the copy file function?