deleting a file ending with a dot

Peter J. Acklam pjacklam@online.no
Fri Jan 16 14:46:00 GMT 2004


Baurjan Ismagulov <ibr@ata.cs.hun.edu.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@online.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/



More information about the Cygwin mailing list