11-23-2020, 05:23 PM
(This post was last modified: 11-23-2020, 06:01 PM by lipinskicad.)
Hello all!
I'm trying to use the FileGetAttributes function to get the modified time of a file on a network drive.
I am getting the following error: failed to get file attributes. The system cannot find the path specified. (0x3).
The function seems to work fine with a files on a local drive (i.e. C:\), but always seems to fail for files on a network drive.
Is there a workaround?
BTW, my goal is to rename a file with a timestamp appended (to the original name).
e.g. file.pdf -> file_2020-11-23.pdf
Here is what I have that works well for local files, but fails with files on a network drive.
If there is an easier way to do this, please provide a direction to explore.
Thanks!
I'm trying to use the FileGetAttributes function to get the modified time of a file on a network drive.
I am getting the following error: failed to get file attributes. The system cannot find the path specified. (0x3).
The function seems to work fine with a files on a local drive (i.e. C:\), but always seems to fail for files on a network drive.
Is there a workaround?
BTW, my goal is to rename a file with a timestamp appended (to the original name).
e.g. file.pdf -> file_2020-11-23.pdf
Here is what I have that works well for local files, but fails with files on a network drive.
FileGetAttributes(f 0 0 t); err out _error.description; ret
t.UtcToLocal
st = t; st.timeformat("_{yyyy-MM-dd}")
fp = f; fp.getpath
fn = f; fn.getfilename
fe = f; fe.GetFilenameExt
f1.from(fp fn st "." fe)
ren f f1
If there is an easier way to do this, please provide a direction to explore.
Thanks!