Hi All,
I'am using cwRsync 2.0.10 and have encountered rsync:File name too long (91) on really long file names. Investigation shows that cygwin have MAXPATHLEN much shorter than that of linux, it can be simple patch for cygwin but I don't want to recompile cwRsync with bigger MAXPATHLEN.
Maybe some one know a way to deal with it without recompilation? Or maybe the reason why MAXPATHLEN in cygwin so short?
rsync: File name too long (91)
Thu, 01/02/2007 - 07:47
#1
rsync: File name too long (91)
Release announcements
- 2024-04-19 Wlighttpd 1.3.0
- 2024-04-19 Wrbldnsd 5.0.1
- 2024-04-09 Copssh server 7.17.1
- 2024-04-09 Copssh server 8.5.1
- 2024-04-09 cwRsync server 6.8.0
THe limitation is about 260 chars and comes from the cygwin layer.
yes i know its cygwin limitation, question is can you change it when copmpiling next version of cwRsync or that limitation have to be there?
Cwrsync uses standard cygwin. As long as cygwin has this limitation, cwrsync has also the same.
I have tried upgrading to the newest cygwin (1.5.24-2) to no avail. Has anyone devised a workaround for this problem? I am also stuck on this as the windows machine has 1000s of very long paths and file names that rsync will give "rsync: readlink (in test) failed: File name too long (91)"
For cygwin to use longer path names, the work is partially done. Cygwin needs to use the unicode win api calls. See here for a patched version does that:
http://www.okisoft.co.jp/esc/utf8-cygwin/
Then, a couple of other things need to be changed. Here is a quote from an email conversation with the author of the cygwin-utf8 patches:
(12/7/2006 7:11 PM)
Wayne wrote:
Maximum Path Length
In the Windows API, the maximum length for a path is MAX_PATH, which is defined as 260 characters. A path is structured in the following order: drive letter, colon, backslash, components separated by backslashes, and a null-terminating character, for example, the maximum path on the D drive is D:\<256 chars>NUL.
The Unicode versions of several functions permit a maximum path length of approximately 32,000 characters composed of components up to 255 characters in length. To specify that kind of path, use the "\\?\" prefix.
For example, "\\?\D:\<path>". To specify such a UNC path, use the "\\?\UNC\" prefix. For example, "\\?\UNC\<server>\<share>". These prefixes are not used as part of the path itself. They indicate that the path should be passed to the system with minimal modification, which means that you cannot use forward slashes to represent path separators, or a period to represent the current directory. Also, you cannot use the "\\?\" prefix with a relative path. Relative paths are limited to MAX_PATH characters.
When using the API to create a directory, the specified path cannot be so long that you cannot not append an 8.3 file name.
The shell and the file system may have different requirements. It is possible to create a path with the API that the shell UI cannot handle.
<END QUOTE>
It is very interesting.
I am sorry for my late response. As for handling path
names in Cygwin, you should look into "class path_conv" in
winsup/cygwin/path.h first. Its private member "char path"
holds the path name to be processed. It represents both a posix (Unix)
path name and a Windows path name, which is why it is difficult to
incorporate Unicode into the middle of cygwin1 and I have taken a wrapper
approach.
Just redefining CYG_MAX_PATH and modifying the wrapper functions
may be sufficient to handle long path names. But I do not have much time
to try it out for now. I am hoping you will try it for yourself. The
patch at http://www.oki-osk.jp/close/osk/index.html is open for everyone.
To compile it:
$ tar xf cygwin-1.5.22-1-src.tr.bz2
$ cd cygwin-1.5.22-1/winsup
$ bzcat ~/winsup-utf8-patch-08-09.diff.bz2 | patch -p0
$ cd ..
$ ./configure
$ make
You will get new-cygwin1.dll in i686-pc-cygwin/winsup/cygwin. This is
explained in Japanese at
http://www.oki-osk.jp/close/osk/index.html
and I hope you read the command lines there.
Best Regards,
Wayne
Hi *all
I'm French, so my english is not very good :-(
Thx for this very good work...
I have the same problem but I don't understant how to resolv it.
I use cwRsync_2_1_0 on WinXp pro.
I tried to replace cygwin1.dll by http://www.okisoft.co.jp/esc/utf8-cygwin/ version but no result :(.
does it exist a full win32 install which take into account this patch ?
Thx for your help
Regards
Unfortunately, this limitation is cygwin specific. AFAIK, the coming version (1.7.x) will address this issue. No idea when it will happen.