If you write a program that uses non-printing chars (in the range 0x00 to 0x1F), samba will create such files when CreateFile (NTCreate&X) is used, while Windows will not. Windows returns the error: STATUS_OBJECT_NAME_INVALID, The filename, directory name, or volume label syntax is incorrect. It seems that Samba should really do the same. Here is some test code to do such things: // This is the main project file for VC++ application project // generated using an Application Wizard. #include "stdafx.h" #include "windows.h" #using <mscorlib.dll> #include <tchar.h> using namespace System; // This is the entry point for this application int _tmain(void) { HANDLE hWriteFile; LPTSTR FileName = "f:\\\\\001\002\003\004\005\006\007\008"; DWORD create_mode = CREATE_ALWAYS, access_mode = GENERIC_READ, share_mode = 0; /* * Use CreateFile to open the file ... */ hWriteFile = CreateFile(FileName, access_mode, share_mode, NULL /* No Security Attrs */, create_mode, 0, NULL); if (hWriteFile == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, NULL ); printf("CreatFile failed: %s\n", lpMsgBuf); return 1; } } You might have to add #include <stdio.h> somewhere to get it to build :-)
The astute reader will have noticed the deliberate mistake. There were two too many backslashes (\) in the file name string. Correcting that still leads to a file being created by Samba and Windows returning the same error.
moving back to 3.0
Rochard, is this still an issues in the latest SAMBA_3_0 tree ?
closing