i have a source file to copy in a target position:
aSource := 'C:\very_very_very_long_path\myfile.exe'; // over 260 chars
aTarget := 'C:\normal_path\myfile.exe';
if not(CopyFile(PChar(aSource), PChar(aTarget), false)) then
RaiseLastOSError;
this code raise exception with code 3 - which means ERROR_PATH_NOT_FOUND
.
the target and source paths exists and if i rename the source to a less long name, it works.
How can i copy a file with long path (over MAX_PATH
)?