delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/01/16/09:28:01

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-WebMail-UserID: pjacklam AT online DOT no
Date: Fri, 16 Jan 2004 15:27:44 +0100
From: "Peter J. Acklam" <pjacklam AT online DOT no>
To: Baurjan Ismagulov <ibr AT ata DOT cs DOT hun DOT edu DOT tr>,
cygwin <cygwin AT sources DOT redhat DOT com>
X-EXP32-SerialNo: 50000140
Subject: RE: deleting a file ending with a dot
Message-ID: <400863B1@epostleser.online.no>
Mime-Version: 1.0
X-IsSubscribed: yes

Baurjan Ismagulov <ibr AT ata DOT cs DOT hun DOT edu DOT tr> wrote:
>
> Peter J. Acklam wrote:
> >
> >     ls -1ib DIR             # find inode number NUM
>
> ls: cachedmetrics.: No such file or directory

Huh.  ls seems to  notice that the directory contains a
file named something like "cachedmetrics.", but yet it
is able to find it.

A wild guess is that readdir() finds it, and tells ls that
the file exists, but when ls does a stat() on the file, it
fails and that's why you get the error.

What is the output if you run the following script with the
directory as the input argument.  It is essentially the
same as "ls -b" but no stat() is done.

------------------------------------------------------
#!/usr/bin/env perl

use strict;
use warnings;

my $dir = shift;

opendir DIR, $dir or die "$dir: can't open directory: $!\n";
for (readdir DIR) {
    #s/([^\040-\176\240-\377])/sprintf '\%03o', ord $1/eg;
    s/([^\040-\176])/sprintf '\%03o', ord $1/eg;
    print $_, "\n";
}
closedir DIR or die "$dir: can't open directory: $!\n";
------------------------------------------------------

> > But I wonder how you created this file in the first place.
> > It seems to me that trailing dots are removed.
>
> Wow! What are the versions of Windows, cygwin and tar?
> I use 2000, 1.3.22, 1.13.25.

Windows XP, Cygwin 1.5.5, tar 1.13.25.

Peter

-- 
Peter J. Acklam - pjacklam AT online DOT no - http://home.online.no/~pjacklam


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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