Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: rm filename length problem Date: Tue, 26 Jul 2005 11:43:14 -0700 Message-ID: <23AA05B1B7171647BC38C5D761900EA4021C93DB@DF-SEADOG-MSG.exchange.corp.microsoft.com> From: Stephan Mueller To: "cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j6QIldBj006278 One other twist on the potential workaround: You can use the Windows _subst_ command to assign a new drive letter to an existing drive\path combination, and then reference the deep files through the new drive letter, effectively shortening the path. It appears that after substing a drive, cygwin mounts it automatically, so aside from the subst invocation itself, all you need to do is cd to the appropriate directory using the new path. Disclaimer: I only tried this on Windows XP Home; mileage on other OSes (particularly Win9x variants) may vary. Not the Beatles. May contain nuts. stephan(); ________________________________ From: cygwin-owner AT cygwin DOT com on behalf of Eric Blake Sent: Tue 7/26/2005 9:52 AM To: Ken Dibble; cygwin Subject: Re: rm filename length problem > I'm having a heck of a time with some long filenames. > > kdibble AT 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&Segm ents=200 > 1081,2001256,2001550,2001551,2001761,2001784,2001916,2002090,2002592,200 3057,200 > 30[1]': > File name too long > rm: cannot remove directory `450JUVMP': Directory not empty Unfortunately, Internet Explorer has a habit of creating filenames that push the limits of what the filesystem can handle. The problem you are running into is not a bug in rm, but a limitation of cygwin1.dll. Dave's suggestion of shortening the overall pathname by moving the containing directory is the best approach I know of. However be aware that the current cygwin filename limitations are on the translated Windows version of the name, so depending on where / is mounted it consumes more or less of the filename buffer limit, not necessarily the length on the command line. > FWIW, rsync complains about some filenames being too long as well. Again, because it is not a bug in rsync, but a fundamental limitation in cygwin/Windows. You can also google this list to learn about attempts to increase the filename length limitation in cygwin for NTFS by using the alternate Windows API that has a more generous length limit (32k instead of 256), but no one has yet contributed a complete patch that does that job without breaking cygwin on Win9x or adding too much overhead. > > cygcheck attached. You know, upgrading may help as well, as there was a patch in cygwin-1.5.15 to increase PATH_MAX by one, which MIGHT have been enough for your example (but no guarantees). Currently, cygwin is at 1.5.18, bash at 3.0-8, and coreutils-5.3.0-9 replaces fileutils-4.1-2. > Cygwin DLL version info: > DLL version: 1.5.11 > bash 2.05b-16 > compface 1.4-5 > cron 3.0.1-12 > fileutils 4.1-2 -- Eric Blake volunteer cygwin coreutils maintainer -- 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/