On 26/01/2010 21
7, Pegasus [MVP] wrote:
>> How do I delete a file / folder in XP which has a trailing space...?
> AFAIK, Windows allows file or folder names with *embedded* spaces but
> not with *trailing* spaces. How exactly did you work out that you had a
> name with a trailing space?
With respect ... actually, NTFS has no problem creating a file with a
trailing space in the name. However Windows Explorer, CMD.EXE and
OS-supplied utilities will usually trim any trailing spaces from a file
name when they manipulate a file. So, yes: a trailing space is rare. But
any app can decide to do:
hFile = CreateFile("My funnny file " // file name
<...> // other params
FILE_ATTRIBUTE_NORMAL, // normal file
NULL);
....and create a file with a trailing space in its name.
Trailing spaces are explicitly deprecated in the Windows SDK's file
naming convention guidelines; but there's nothing to actually stop
someone from doing it.
You are correct that the U+00A0 "No break space" char can also look like
a space, and is indeed legal at the end of file names.
Apologies for being a pedantic pain-in-the-butt, but ... I get all
pedantic, sometimes
Cheers
Andrew
--
amclar at optusnet dot com dot au