From: Adrien Reboisson on 2 Feb 2010 12:44 Hi, CreateDirectory("C:\Foo\ BAR ") creates the folder " BAR" in "C:\Foo", instead of creating the directory " BAR " (notice the spaces *before* and *after* "BAR"). Why ? Is it a documented feature ? Why are the spaces on the right removed by Windows ? I suspect that could be a compatibility "feature", but anyway that's not stated in the "Remarks" section in MSDN : http://msdn.microsoft.com/en-us/library/aa363855(VS.85).aspx I'm running Windows 7... Any hints appreciated ;) Best regards, A.R.
From: Keith Moore on 2 Feb 2010 14:18 On 2/2/2010 9:44 AM, Adrien Reboisson wrote: > Hi, > > CreateDirectory("C:\Foo\ BAR ") creates the folder " BAR" in > "C:\Foo", instead of creating the directory " BAR " (notice the spaces > *before* and *after* "BAR"). > > Why ? Is it a documented feature ? Why are the spaces on the right > removed by Windows ? I suspect that could be a compatibility "feature", > but anyway that's not stated in the "Remarks" section in MSDN : > http://msdn.microsoft.com/en-us/library/aa363855(VS.85).aspx > > I'm running Windows 7... Any hints appreciated ;) > > Best regards, > > A.R. From http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx "Do not end a file or directory name with a space or a period. Although the underlying file system may support such names, the Windows shell and user interface does not." You *might* be able to use the "\\?\" prefix to create a file/directory with trailing spaces, but given the above statement and given the behavior of many applications (cmd.exe, explorer.exe, etc) it's probably a really bad idea.
From: Adrien Reboisson on 3 Feb 2010 10:58 Thank you. I was aware of a lot of file naming limitations, but not this one. Cheers, A.R.
|
Pages: 1 Prev: PID for events generated by the clipboard and/or by OLE Next: Windows 7 enable Ndis trace log |