Page 1 of 1
Size of path in FileCopy function ? [Resolved]
Posted: Wed Sep 04, 2013 4:05 pm
by Kwai chang caine
Hello at all
Are they a limit for the path for the instruction CopyFile ?
Because i have
Code: Select all
CopyFile(PathA+ PathB, PathC + PathB)
And
Code: Select all
Len(PathA + PathB) = 164
Len(PathC + PathB) = 261
Apparently that work if the second parametre is "c:\Temp"
Code: Select all
CopyFile(PathA+ PathB, "C:\Temp\File.dll")
Good day
Re: Size of path in FileCopy function ?
Posted: Wed Sep 04, 2013 4:41 pm
by ts-soft
The limit on windows (ASCII) is 260, including nullbyte!
Re: Size of path in FileCopy function ?
Posted: Wed Sep 04, 2013 4:51 pm
by Kwai chang caine
It's the reason why
Thanks a lot TsSoft

Re: Size of path in FileCopy function ? [Resolved]
Posted: Wed Sep 04, 2013 9:10 pm
by IdeasVacuum
You can test it against #MAX_PATH
Re: Size of path in FileCopy function ? [Resolved]
Posted: Wed Sep 04, 2013 9:52 pm
by Kwai chang caine
Yes i have forgotten this constant
Thanks too IdeasVacuum

Re: Size of path in FileCopy function ? [Resolved]
Posted: Wed Sep 04, 2013 11:54 pm
by normeus
I try to use UNC most of the time:
Code: Select all
pathc = "G:\movies\there are 254 characters minus one or two\for this path\"
should look like this:
Code: Select all
pathc = "\\?\G:\movies\there are 254 characters minus one or two\for this path\"
people get really wordy with their paths at my place and UNC could go up to 32k chars
Norm.
Re: Size of path in FileCopy function ? [Resolved]
Posted: Thu Sep 05, 2013 12:52 am
by IdeasVacuum
...that would be long UNC or UNCW