[Box Backup] Long path names, open files, etc

Achim boxbackup at boxbackup.org
Mon Mar 30 12:12:17 BST 2009


Good day:

On Sun, 29 Mar 2009 08:39:45 -0700, dnk <d.k.emaillists at gmail.com> wrote:
> On 28-Mar-09, at 11:24 PM, Chris Wilson wrote:
>> Box should support file names as long as Windows can. If not, please  
>> let us know. We don't use Cygwin apart from the build process, so  
>> Cygwin limitations should not apply.
> 
> Oh really? That is a major plus! That is cool that box backup has zero  
> reliance on cygwin after the build process. So does box backup not use  
> rsync under the hood?

Chris already answered that question. I ran some quick tests on long
filenames and wanted to share the results:

Basically, the maximum limit for length of names for files is 260
characters (including path information). Let's create a use case for this
scenario:

In Cygwin:

$ while true; do mkdir pathname_test; cd pathname_test; done

which will eventually fail with
mkdir: cannot create directory `pathname_test': File name too long 
bash: cd: pathname_test: No such file or directory

so you have to hit CTRL-C to interrupt the "while true" loop.

$ pwd
/usr/src/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test/pathname_test

$ echo "longfilenametest" > afile

When you backup the file now (which works fine), the restore via
bbackupquery to a short enough path works:
lcd D:1234567890123456789012345678901234567890
restore filenames filename_test

but restoring to longer (local) paths seems to work, but the resulting
directory is not accessible: explorer does not allow to open it
restore filenames
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
restore filenames
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890

in cmd.exe:
"The system cannot find the path specified"

in Cygwin:
"File name too long"

Not only can you not access the folder contents, you actually have to
rename the folders to shorter names in order to be able to delete them!

For more information on file name length limitations:
<http://www.adarshr.com/papers/verylong>

The maximum length of a file’s name is dependant on the physical location
of the file. 

In NTFS, the allowable maximum length for a file’s name is calculated
based on its absolute path. This means that the length of a file’s name
is not just the length of the name of that file. It is a sum of the length
of the absolute path of the file and the length of its actual name. For
instance, if we have a file called LongFileName.extension (22 characters)
located in C:\Windows directory, the length of its name is interpreted to
be the length of C:\Windows\LongFileName.extension which is 33 characters.

The maximum limit for length of names for files is 260 characters.

Detailed information at
<http://msdn.microsoft.com/en-us/library/aa365247.aspx>


>>> Also, how does it deal with open files?
>>
>> On Windows, open files which are exclusively locked cannot be  
>> opened, even for backup, so they are skipped with a warning. See  
>> this ticket for a workaround: http://www.boxbackup.org/trac/ticket/13

VSS would be an amazing addition to Box Backup! It allows you to backup
Outlook PST files without problems. This filetype is probably
(unfortunately) one of the most mission critical pieces out there, given
how much people rely on e-mail these days.

Is the coding very complicated, or would it possibly break Box on platforms
other than Windows?



More information about the Boxbackup mailing list