This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
RE: deleting a file ending with a dot
- 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>
- Date: Fri, 16 Jan 2004 15:27:44 +0100
- Subject: RE: deleting a file ending with a dot
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/