public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: deleting a file ending with a dot
@ 2004-01-16 13:49 Peter J. Acklam
  2004-01-16 14:07 ` Baurjan Ismagulov
  0 siblings, 1 reply; 31+ messages in thread
From: Peter J. Acklam @ 2004-01-16 13:49 UTC (permalink / raw)
  To: Baurjan Ismagulov, cygwin

Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr> wrote:

> tar has created a file ending with a dot, and now I can't delete
> it (I've tried rm, del in cmd, explorer, far, unlink call with
> and without -mno-cygwin). What would you suggest before I search
> an 8-GB volume for the directory entry with a disk editor? I
> would appreciate any help (pointers to NTFS directory structure
> description also welcome).  Scandisk didn't report any problems.

A common way in Unix to delete files with strange names is by
using the inode number:

    ls -1ib DIR                               # find inode number NUM
    find DIR -xdev -inum NUM -exec rm {} \;   # remove the file

but, alas, I don't think that works either.

But I wonder how you created this file in the first place.  It
seems to me that trailing dots are removed.  Here is what I get
when I extract a tar file containing files with trailing dots.
(The tar file was created on Solaris.):

   $ tar xvf bad.tar
   foo/
   foo/bar0
   foo/bar1.
   foo/bar2..
   foo/bar3...
   foo/bar4....
   foo/bar5.....

   $ ls -1 foo
   bar0
   bar1
   bar2
   bar3
   bar4
   bar5

The dots are gone.

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/

^ permalink raw reply	[flat|nested] 31+ messages in thread
* RE: deleting a file ending with a dot
@ 2004-01-16 17:34 Hughes, Bill
  0 siblings, 0 replies; 31+ messages in thread
From: Hughes, Bill @ 2004-01-16 17:34 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

Sent: 16 January 2004 16:34 From: Igor Pechtchanski
> > On Fri, Jan 16, 2004 at 04:21:17PM -0000, Hughes, Bill wrote:
> > >Sent: 16 January 2004 16:15 From: Christopher Faylor
> > >> If you mean the "Sender" field, then, yes, this is one way to filter.
> > >> Or you can filter on the Mailing-List field or the List-* fields.
> > >>
> > >> It's really not too hard to figure something to filter on if you look
> > >> at the full headers.
> > >>
> > >> (and now we hear from all of the people who say "My client doesn't
allow
> > >that!!!!")
> > >
> > >If I can do it in Outlook... :-)
> > >I just filter on cygwin... anywhere in the header.
> >
> > Please! don't add clear text mail addresses in email messages.
>This is a good rule of thumb, but it's rather useless for the cygwin@ list
>address itself -- the first line of any message in the archives says 'This
>is the mail archive of the cygwin<at>cygwin<dot>com mailing list for the
>Cygwin project.' (unscrambled, of course). :-)

I know that, but let's not make it any easier, and it's the _principle_ of
the thing, after all.

--
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/

^ permalink raw reply	[flat|nested] 31+ messages in thread
* RE: deleting a file ending with a dot
@ 2004-01-16 16:37 Hughes, Bill
  0 siblings, 0 replies; 31+ messages in thread
From: Hughes, Bill @ 2004-01-16 16:37 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

Sent: 16 January 2004 16:25 From: Christopher Faylor
> Please! don't add clear text mail addresses in email messages.
Argh! Sorry. I have to work to get Outlook to format as I want (remove
addys) and then I manually put one in. Doh.
Apologies again, the only explanation (not excuse) is that it's Friday pm
here .

--
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/

^ permalink raw reply	[flat|nested] 31+ messages in thread
* RE: deleting a file ending with a dot
@ 2004-01-16 16:29 Hughes, Bill
  2004-01-16 16:34 ` Christopher Faylor
  0 siblings, 1 reply; 31+ messages in thread
From: Hughes, Bill @ 2004-01-16 16:29 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

Sent: 16 January 2004 16:15 From: Christopher Faylor
> If you mean the "Sender" field, then, yes, this is one way to filter.
> Or you can filter on the Mailing-List field or the List-* fields.
>
> It's really not too hard to figure something to filter on if you look
> at the full headers.
>
> (and now we hear from all of the people who say "My client doesn't allow
that!!!!")

If I can do it in Outlook... :-)
I just filter on cygwin@cygwin.com anywhere in the header.


--
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/

^ permalink raw reply	[flat|nested] 31+ messages in thread
* RE: deleting a file ending with a dot
@ 2004-01-16 15:24 Buchbinder, Barry (NIH/NIAID)
  0 siblings, 0 replies; 31+ messages in thread
From: Buchbinder, Barry (NIH/NIAID) @ 2004-01-16 15:24 UTC (permalink / raw)
  To: cygwin

If Windows lets tar create a file that Explorer cannot remove, it sounds
like a Windows problem.

(1)
Try rebooting.  Maybe one of your earlier attempts to delete succeeded but
some file name cache is preserving the name.  (I've noticed that on rare
occasions a file gets deleted but Explorer still shows it.)

(2)
Run scandisk.  Maybe it will find the problem and fix it.

(3)
I'd try this in Explorer.
(a) Create a new temporary directory.
(b) Copy or move everything in the directory with the troublesome file to
the temporary directory.
(c) Delete the directory with the troublesome file.  I'd try holding down
the shift key, which really deletes, rather than just send the directory to
the Recycle Bin.  (We're trying to fix the problem not just move it.)  If it
won't delete, just move it somewhere out of the way and forget about it for
now.  (Maybe someday you will find that it has fixed itself.)
(d) Move or rename the temporary directory to the name and place of the now
deleted directory with the troublesome file.  Or recreate the deleted
directory and move stuff back.

-----Original Message-----
From: Baurjan Ismagulov [mailto:ibr@ata.cs.hun.edu.tr] 
Sent: Friday, January 16, 2004 6:57 AM
To: cygwin@sources.redhat.com
Subject: deleting a file ending with a dot

Hello,

tar has created a file ending with a dot, and now I can't delete it
(I've tried rm, del in cmd, explorer, far, unlink call with and without
-mno-cygwin). What would you suggest before I search an 8-GB volume for
the directory entry with a disk editor? I would appreciate any help
(pointers to NTFS directory structure description also welcome).
Scandisk didn't report any problems.

Thanks in advance,
Baurjan.

--
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/

^ permalink raw reply	[flat|nested] 31+ messages in thread
* RE: deleting a file ending with a dot
@ 2004-01-16 14:46 Peter J. Acklam
  0 siblings, 0 replies; 31+ messages in thread
From: Peter J. Acklam @ 2004-01-16 14:46 UTC (permalink / raw)
  To: Baurjan Ismagulov, cygwin

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/

^ permalink raw reply	[flat|nested] 31+ messages in thread
* RE: deleting a file ending with a dot
@ 2004-01-16 14:07 Morche Matthias
  0 siblings, 0 replies; 31+ messages in thread
From: Morche Matthias @ 2004-01-16 14:07 UTC (permalink / raw)
  To: cygwin

Your answer confirms my assumption that there are hidden chars trailing the dot: try ls -q cachedmetrics* and use the result to delete...


> -----Original Message-----
> From: cygwin-owner@cygwin.com 
> [mailto:cygwin-owner@cygwin.com]On Behalf
> Of Baurjan Ismagulov
> Sent: Friday, January 16, 2004 2:53 PM
> To: cygwin@sources.redhat.com
> Subject: Re: deleting a file ending with a dot
> 
> 
> Hello, David!
> 
> On Fri, Jan 16, 2004 at 12:05:31PM -0000, Dave Korn wrote:
> >   Maybe there's a problem with the perms on it?  What 
> output do you get from
> > "ls -la file." and from "cacls file." ?
> 
> ls: cachedmetrics.: No such file or directory
> 
> I don't have cacls installed, but getfacl also says "No such file or
> directory".
> 
> 
> >   BTW, this would have been a better bug report...
> 
> I'm afraid that this is a Windows feature :) -- to be able to create
> files and then not to be able to work with them :/ .
> 
> 
> > ... if you had told us what
> > actually *happened* when you tried all those things - did 
> you get error
> > messages?  Did unlink return an error code?  Or did just 
> nothing happen?  Or
> > did your machine BSOD and start smoke pouring out the back? 
>  Knowing what
> > happened is the first clue to start working out what went 
> wrong, you see.
> 
> Thanks for the tip :) . All programs said that they cannot find such a
> file. Unlink returned ENOENT. When I click on "Properties", 
> there is no
> file name in the window.
> 
> 
> With kind regards,
> Baurjan.
> 
> --
> 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/
> 
> 

--
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/

^ permalink raw reply	[flat|nested] 31+ messages in thread
* RE: deleting a file ending with a dot
@ 2004-01-16 12:29 Morche Matthias
  2004-01-16 14:06 ` Baurjan Ismagulov
  0 siblings, 1 reply; 31+ messages in thread
From: Morche Matthias @ 2004-01-16 12:29 UTC (permalink / raw)
  To: cygwin

Are You shure the filename ends with that dot? Maybe there are unreadable chars appended, so Yozu never gave the correct filename when deleting...
I tried to create a file ending with a dot and did not succeed.


> -----Original Message-----
> From: cygwin-owner@cygwin.com 
> [mailto:cygwin-owner@cygwin.com]On Behalf
> Of Baurjan Ismagulov
> Sent: Friday, January 16, 2004 12:57 PM
> To: cygwin@sources.redhat.com
> Subject: deleting a file ending with a dot
> 
> 
> Hello,
> 
> tar has created a file ending with a dot, and now I can't delete it
> (I've tried rm, del in cmd, explorer, far, unlink call with 
> and without
> -mno-cygwin). What would you suggest before I search an 8-GB 
> volume for
> the directory entry with a disk editor? I would appreciate any help
> (pointers to NTFS directory structure description also welcome).
> Scandisk didn't report any problems.
> 
> Thanks in advance,
> Baurjan.
> 
> --
> 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/
> 
> 

--
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/

^ permalink raw reply	[flat|nested] 31+ messages in thread
* deleting a file ending with a dot
@ 2004-01-16 12:11 Baurjan Ismagulov
  2004-01-16 12:26 ` Dave Korn
  2004-01-17 10:36 ` Gene C. Ruzicka
  0 siblings, 2 replies; 31+ messages in thread
From: Baurjan Ismagulov @ 2004-01-16 12:11 UTC (permalink / raw)
  To: cygwin

Hello,

tar has created a file ending with a dot, and now I can't delete it
(I've tried rm, del in cmd, explorer, far, unlink call with and without
-mno-cygwin). What would you suggest before I search an 8-GB volume for
the directory entry with a disk editor? I would appreciate any help
(pointers to NTFS directory structure description also welcome).
Scandisk didn't report any problems.

Thanks in advance,
Baurjan.

--
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/

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2004-01-21 18:09 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-16 13:49 deleting a file ending with a dot Peter J. Acklam
2004-01-16 14:07 ` Baurjan Ismagulov
2004-01-16 14:14   ` David T-G
2004-01-16 14:20     ` David T-G
2004-01-16 15:20     ` David Fritz
2004-01-16 15:37       ` David T-G
2004-01-16 16:18       ` Dave Korn
2004-01-16 16:22         ` Christopher Faylor
2004-01-16 21:56         ` Brian Dessent
  -- strict thread matches above, loose matches on Subject: below --
2004-01-16 17:34 Hughes, Bill
2004-01-16 16:37 Hughes, Bill
2004-01-16 16:29 Hughes, Bill
2004-01-16 16:34 ` Christopher Faylor
2004-01-16 16:46   ` Igor Pechtchanski
2004-01-16 18:10     ` Christopher Faylor
2004-01-16 15:24 Buchbinder, Barry (NIH/NIAID)
2004-01-16 14:46 Peter J. Acklam
2004-01-16 14:07 Morche Matthias
2004-01-16 12:29 Morche Matthias
2004-01-16 14:06 ` Baurjan Ismagulov
2004-01-16 12:11 Baurjan Ismagulov
2004-01-16 12:26 ` Dave Korn
2004-01-16 14:01   ` Baurjan Ismagulov
2004-01-16 14:13     ` Dave Korn
2004-01-21 18:33       ` Baurjan Ismagulov
2004-01-16 20:57     ` Andrew DeFaria
2004-01-16 21:53       ` Rafael Kitover
2004-01-16 23:04       ` Christopher Faylor
2004-01-17  2:08         ` Rafael Kitover
2004-01-16 20:44   ` Andrew DeFaria
2004-01-17 10:36 ` Gene C. Ruzicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).