colons in filename
It appears creating a file with filename like:
C:\Test\This is a testfile:Foo.bar
using CreateFileW is permitted (shown as "C:\Test\This is a testfile" only), but causes several problems when accessing or deleting. The problems vary a bit, but the following issues seem to be 'constant':
- First attemt to delete using DeleteFileW with the original full filename reports success, subsequent calls report failure. The file still exists.
- It appears the file can only be deleted using the trunctated filename when using DeleteFileW API.
Tested with Windows 7 home premium 64bit us and Windows XP professional 32bit german
October 23rd, 2012 6:05am
File names containing a colon outside the drive designation are illegal under Windows. While it might be possible to create them, why would you do want to do this:
What actually is your question?
Free Windows Admin Tool Kit Click here and download it now
October 23rd, 2012 6:22am
On Tue, 23 Oct 2012 10:05:58 +0000, RetiCenceLA wrote:
In Windows, a file name cannot contain
\ / : * ? " < > |
Note that includes the colon.
In the example you give:
C:\Test\This is a testfile
the ":" is not part of the file name. Rather it demarcates the drive designation in the path name. The file name is "This is a testfile".
See:
Naming Files, Paths, and Namespaces for more information on naming files in Windows
Ron
October 23rd, 2012 7:55am