This is the mail archive of the
mailing list for the Cygwin project.
Re: open() giving ENOENT when trying to create files with control chars
On Fri, Dec 02, 2005 at 11:09:05PM +0100, Corinna Vinschen wrote:
> On Dec 2 20:38, Eric Blake wrote:
> > > I'm trying to create a file (on NTFS) with a CR in the name and getting
> > > ENOENT; is it possible for this to work (without a managed mount)?
> > Welcome to Windows. None of these non-portable characters are
> > supported in filenames except in managed mounts.
> Just to push the point a bit, note the words "non-portable".
Moving on to another "non-portable" problem, I want to create a file
with a space at the end of the name, but cygwin is stripping spaces.
Despite the comment in the code, this does seem to be allowed (though
I suspect it may be via NtCreateFile only, since windows commands
don't seem to handle filenames with spaces at the end well). I tried
--- path.cc.orig 2005-10-24 03:33:48.532065000 -0700
+++ path.cc 2005-12-08 11:39:23.237267200 -0800
@@ -482,7 +482,7 @@ path_conv::set_normalized_path (const ch
- while (*--p == '.' || *p == ' ')
+ while (*--p == '.') // || *p == ' ')
*++p = '\0';
@@ -957,7 +957,7 @@ out:
/* Windows ignores trailing dots and spaces */
char *tail = NULL;
for (char *p = path; *p; p++)
- if (*p != '.' && *p != ' ')
+ if (*p != '.') // && *p != ' ')
tail = NULL;
else if (p == '\\')
and with limited testing on XP Pro SP1 didn't find any problems. Is
it possible this space-stripping predates use of NtCreateFile? Are
there problems likely to arise with this (e.g. cygwin calling other
winapi functions that are passed filenames not correctly handling
spaces at the end)?
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html