Question on a long filename

Allen, John L. ALLENJO5 at mail.northgrum.com
Sat Oct 19 15:29:00 EST 2002


> -----Original Message-----
> From: jw schultz [mailto:jw at pegasys.ws]
> Sent: Friday, October 18, 2002 6:35 PM
> To: rsync at samba.org
> Subject: Re: Question on a long filename
> 
> On Fri, Oct 18, 2002 at 08:58:29AM -0700, Jennifer Lu wrote:
> > 
> > Hi,
> > 
> > How many characters of the file name can be transferred thru rsync?
> > 255? I am running rsync on solaris 5.8 machine, I got the following
> > error messages:
> > 
> > ERROR: dsync: dsync1:/import/data/ to dsync2:/import/data2/
> > mkstemp  failed: File name too long
> > rsync error: partial transfer (code 23) at main.c(578)
> > 
> > The filename in that directory is over 220 characters, is there 
> > a problem on a long filename?
> 
> Clearly there is.  The limit isn't rsync but the OS and
> filesystem.
> 
> For each file updated rsync uses mkstemp (from the system
> libs) to create a temp file using a template of ".%s.XXXXXX"
> which should mean that the temp file name will be 8
> characters longer than the primary file.
> 
> It's been awhile but my reccolection is that the maximum
> length of a filename on UFS is 254 characters.  Solaris may
> trim that a bit to 252 or less.
> 
> The upshot is that the maximum filename length that may be
> syncronized is 8 less than the length supported by the
> destination filesystem.

It seems to me that this limit could be overcome if rsync
used a different temp file name.  One obvious choice would
be to simply use a short temp name that is little more than a
sequence number, with a template of, say, ".rsync.%d.XXXXXX".
If it is desired to have the name of the original file in the
temp file name for error recovery purposes, you could use
the original template of ".%s.XXXXXX", but only include the
first OSMAX - 8 chars of the original file name, where OSMAX
is the maximum file name length for the OS.

Why impose this limit on file name length if you don't have to?

John.



More information about the rsync mailing list