tags:

views:

534

answers:

4

For e.g. if i am storing some files on a network server which is under many hiearchial folders.

Then i want to do backup. But i always encounter issue because the file path is more than 255?

How can i resolve this issue or work around it?

+1  A: 

Maybe upgrade to an Operating System that's been updated in the last decade or so? Seriously, though - what OS and file system are you using? Even FAT32 supports long path and file names, though any single component of the path is limited to 255 characters.

If you've got directories with more than 255 characters in their name, then that's problematic (and a little weird). To work around that issue, you could consider using an archiving utility (tar or zip) run on the server, then ship the archive over to yuor desktop machine.

Mark Bessey
+1  A: 

Preface: I'm assuming the OS of the machine you want to copy the files to is some flavor of Windows.

The first part of Mark Bessey's is somewhat correct, however even on modern versions of windows with modern filesystems (NTFS for example) you can still run into problems.

I suspect the limitation you're running into is due to MAX_PATH, which is a predefined limit on the length of a path that many APIs on Windows will accept.

You may try using Robocopy to do the backup as it is able to create paths longer than the MAX_PATH limitation. However, most applications will not be able to access these files.

Taring or Zipping the files may be a good plan but it seems unlikely that you'd be able to unzip or untar them to a Windows machine.

Matt Ellis
A: 

What OS, What protocol?

All I can see is: CoreFSIF with a limit of 256 chars.

Steve
A: 

What you are seeing is Win32's MAX_PATH limit (MAX_PATH is 260).

There are "escapes" on the API to be able to use NT's larger limit of 32767 characters (prepending \\?\ to the path), which however only work on some of the APIs. Files created this way tend to confuse other programs which expect all paths to fit in MAX_PATH-sized buffers.

The way to work around this (for backup/restore) is to find a program which can backup (and restore!) files with longer paths (by either always using the API "escapes" or the underlying NT API). Another option is to do the backup/restore with a different operating system.

CesarB