This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cvs


Hi Lothan,


"Lothan" <lothan@newsguy.com> writes:
> I'm using Cygwin 1.1.6 (full install from scratch using the setup
> tool) on Windows 2000 SP1 and am attempting to check out the gnome
[...]
>     f = creat(".new.:0", O_RDWR | O_CREAT);
[...]
> WARNING: run the resulting executable in an empty directory. The
> only way I can delete the file is to delete the directory from a
> Windows command prompt (rd test). I did try unlink(".new.:0") but it
> failed.

Interesting problem ;-)

When you use a filename "something:somename" on NTFS you actually
access the "alternate data stream" named "somename" in the file called
"something".  "Alternate data streams" is the technology that MS uses
to implement MacOS resource forks (for their Appletalk server) and how
they attach other additional info to files.

OTOH trailing periods in filenames are stripped by the Win32
subsystem, but not by the NT kernel or the NTFS file system driver.
This can cause some confusion.  In this case, because the period was
not "trailing" in the original filename ".new.:0", NT actually created
a file called ".new.".  But because the Win32 subsystem strips
trailing periods, you can't access the filename without the stream
part, e.g. to delete the file.

Note that you can always undercut the Win32 subsystem by giving the
full Windows path and prepend "\\?\" as a marker that the name should
be used as-is by all modules that would otherwise try some kind of
parsing.  E.g. something like

  rm '\\?\c:\tmp\.new.'

worked in my experiments. 


so long, benny
-- 
ISION Internet AG
Benjamin Riefenstahl
mailto:benjamin.riefenstahl@ision.net

Harburger Schlossstr. 1
D-21079 Hamburg
http://www.ision.net


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]