[fpc-pascal] Deleting 'Nonexistent' files under windows

J├╝rgen Hestermann juergen.hestermann at gmx.de
Wed Jan 25 11:08:59 CET 2017

Am 2017-01-24 um 18:44 schrieb Bart:
> I once created a folder and file using W API and \?\\ syntax for testing purposes.
> This all went well, but Windows did not like it and would not let me
> remove the file and folder.
> I rewote my test program to remove them, but still Windows refused.
> (The folder name ended in a space, you could not even browse to the
> folder in Windows Explorer)

I have written a file manager which uses the (Unicode) Windows API with \?\\ syntax
and I never had any problems deleting long paths (testet up to 35,000 characters)
or such which have whitespace somewhere.

Of course, you have to make sure, that whitespace is not removed by some
other functions before you use the name and you also need to make sure that
UTF-16 is used for the API function.

More information about the fpc-pascal mailing list