Problems with directories names which end with a trailing space
Posted: 25 Jan 2022, 00:06
I see some errors while trying to backup some directory or file with a name that ends with a trailing space, for example: ""C:\My directory ";
This is a limitation of the Windows Api. The file system supports those kind of names (and tose are files that often are created by MacOS".
From MSDN "Naming Files, Paths, and Namespaces (Windows)":
--
This is a limitation of the Windows Api. The file system supports those kind of names (and tose are files that often are created by MacOS".
From MSDN "Naming Files, Paths, and Namespaces (Windows)":
So this will be causing a lot of errors, caused by Windows API.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.
Problems can arise when a Macintosh client creates a file on a Windows NT server. The code to remove trailing spaces and periods is not carried out and the Macintosh user gets the correctly punctuated filename. The Win32 APIs FindFirstFile() and FindNextFile() return a filename that ends in a space or in a period; however, there is no way to create or open the file using the Win32 API.
--