rm filename length problem

Ken Dibble kdibble@alltel.net
Tue Jul 26 16:30:00 GMT 2005


I'm trying to script a cleanup of some directories prior to backup.

I'm having a heck of a time with some long filenames.

kdibble@BECCOMPUTER /cygdrive/c/Documents And Settings/Ken Dibble/Local 
Settings/Temporary Internet Files/Content.IE5
$ ls
450JUVMP  ETYH0R2P  QDB49KJ2  W1MRMJYV  ZJH
8DQF2381  MLNC1W3E  SRSVUZKZ  ZJ1VVLGK  ind

kdibble@BECCOMPUTER /cygdrive/c/Documents And Settings/Ken Dibble/Local 
Settings/Temporary Internet Files/Content.IE5
$ rm -Rf *
rm: cannot remove 
`450JUVMP/Type=click&FlightID=1991987&AdID=1986689&TargetID=2006165&Segments=2001081,2001256,2001550,2001551,2001761,2001784,2001916,2002090,2002592,2003057,20030[1]': 
File name too long
rm: cannot remove directory `450JUVMP': Directory not empty

kdibble@BECCOMPUTER /cygdrive/c/Documents And Settings/Ken Dibble/Local 
Settings/Temporary Internet Files/Content.IE5
$ cd ETYH0R2P

kdibble@BECCOMPUTER /cygdrive/c/Documents And Settings/Ken Dibble/Local 
Settings/Temporary Internet Files/Content.IE5/ETYH0R2P
$ ls | wc -l
      2

kdibble@BECCOMPUTER /cygdrive/c/Documents And Settings/Ken Dibble/Local 
Settings/Temporary Internet Files/Content.IE5/ETYH0R2P
$ ls
Type=click&FlightID=1991463&AdID=1986669&TargetID=2006230&Segments=120,2528,2000962,2001081,2001256,2001295,2001412,2001550,2001551,2001761,2001784,2001[1].htm
Type=click&FlightID=1991464&AdID=1986670&TargetID=2006230&Segments=120,2528,2000962,2001081,2001256,2001295,2001412,2001550,2001551,2001761,2001784,2001[1]

a plain remove fails:

kdibble@BECCOMPUTER /cygdrive/c/Documents And Settings/Ken Dibble/Local 
Settings/Temporary Internet Files/Content.IE5/ETYH0R2P
$ rm *
rm: cannot remove 
`Type=click&FlightID=1991463&AdID=1986669&TargetID=2006230&Segments=120,2528,2000962,2001081,2001256,2001295,2001412,2001550,2001551,2001761,2001784,2001[1].htm': 
File name too long
rm: cannot remove 
`Type=click&FlightID=1991464&AdID=1986670&TargetID=2006230&Segments=120,2528,2000962,2001081,2001256,2001295,2001412,2001550,2001551,2001761,2001784,2001[1]': 
File name too long


as does my attempt at fooling it with xargs:

kdibble@BECCOMPUTER /cygdrive/c/Documents And Settings/Ken Dibble/Local 
Settings/Temporary Internet Files/Content.IE5/ETYH0R2P
$ ls | xargs /bin/rm
/bin/rm: cannot remove 
`Type=click&FlightID=1991463&AdID=1986669&TargetID=2006230&Segments=120,2528,2000962,2001081,2001256,2001295,2001412,2001550,2001551,2001761,2001784,2001[1].htm': 
File name too long
/bin/rm: cannot remove 
`Type=click&FlightID=1991464&AdID=1986670&TargetID=2006230&Segments=120,2528,2000962,2001081,2001256,2001295,2001412,2001550,2001551,2001761,2001784,2001[1]': 
File name too long

Any help is appreciated ( Yes this means pointing out my stupidity! ).

FWIW, rsync complains about some filenames being too long as well.

cygcheck attached.

Thanks,
Ken
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050726/acfbc0c1/attachment.ksh>
-------------- next part --------------
--
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