PDA

View Full Version : Windows file name size



billbenson
05-13-2012, 06:52 PM
I've been using linux for years, but I want to put my files on a windows computer as well.

A couple of questions:

When moving some files to the windows machine I get an error that the file name is to long. Does Windows still have a maximum file name size that is shorter than Linux? I have long file names to add a description in the file. It may be a pdf that says product-brochure-model-number.pdf

I've trashed a couple of external usb hard drives moving them between computers. I format them in FAT in the Linux computer, save files, move to the Windows computer, the drive isn't recognized. I go back to the Linux computer and the drive isn't recognized either...

One thought is to put a windows partition on my Linux machine. But if memory serves me correctly, Linux reads windows but will not save to windows?

Any thoughts and ideas would be appreciated!

MyITGuy
05-14-2012, 06:42 AM
Does Windows still have a maximum file name size that is shorter than Linux?
In short, 256 character file names, up to a maximum of 32K characters if the method your using takes advantage of the unicode version of the API, otherwise your limited to a total of 260 characters.

Naming Files, Paths, and Namespaces (Windows) (http://msdn.microsoft.com/en-us/library/aa365247.aspx)


In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters.
The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters.
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.


One thought is to put a windows partition on my Linux machine. But if memory serves me correctly, Linux reads windows but will not save to windows?

The following may assist if you want to use NTFS File Systems in Linux: How to mount partition with ntfs file system and read write access (http://linuxconfig.org/How_to_mount_partition_with_ntfs_file_system_and_r ead_write_access)

However, you could also use FAT (And FAT32?) which removes the security/permissions issue that is present with an NTFS file system.

kerrylinux
05-17-2012, 01:27 PM
It's generally not a good idea to use FAT filesystems for data transfer between worlds. Just make sure that you have the packages ntfs-3g and ntfsprogs installed and use "mkntfs" to create a filesystem that can be read and written from both sides.