I'm running Windows 7 in a VirtualBox on an OS X 10.8 host. The host has a shared folder with a file named >>>FILE<<<
inside. Apparently, OS X itself has no problem with such file names. Unfortunately, I can't seem to open this files in Windows 7 because of the <
s and >
s in the name.
In C, this call fails:
CreateFileW(
L"\\\\VBOXSVR\\ft1\\>>>FILE<<<",
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
GetLastError
returns ERROR_INVALID_NAME
(123). If I change the file name into FILE
, I get a valid handle and everything is fine.
Is there a known way in Windows to access those files with invalid characters in their names? Supposing a productive environment with no direct write access to the host's file system.