delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/12/18/06:30:55

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
To: "Cygwin" <cygwin AT cygwin DOT com>
Subject: Re: cvs
References: <EJEMICJMAGCJAPFPGPLGGEHPCFAA DOT lothan AT newsguy DOT com>
From: Benjamin Riefenstahl <Benjamin DOT Riefenstahl AT ision DOT net>
Date: 18 Dec 2000 12:30:07 +0100
In-Reply-To: "Lothan"'s message of "Sun, 17 Dec 2000 17:14:28 -0800"
Message-Id: <ulmte0xxc.fsf@mail.crocodial.de>
Lines: 49
User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7
MIME-Version: 1.0

Hi Lothan,


"Lothan" <lothan AT newsguy DOT 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 DOT riefenstahl AT ision DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019