I am trying give a name for a file that I am creating. I just want to know that what is the max file name length in Android ?
Is there a specification for a file name? Can I use characters like -
or >
?
The Windows API imposes a maximum filename length such that a filename, including the file path to get to the file, can't exceed 255-260 characters.
The maximum filename length on a NTFS partition is 256 characters, and 11 characters on FAT (8 character name, . , 3 character extension). NTFS filenames keep their case, whereas FAT filenames have no concept of case (however the case is ignored when performing a search etc on NTFS).
The 255 characters are the system's limit.
What is the maximum length of a file name? Windows usually limits file names to 260 characters. But the file name must actually be shorter than that, since the complete path (such as C:\Program Files\filename. txt) is included in this character count.
It is apparently unsafe to use labels over 127 bytes on Android. AFAIK, the 255 limit is a goal, but is a WIP. I trashed my Galaxy Tab 10.1's sdcard file system last week when music sync software generated some filenames of around 160 characters. Limiting the filenames to 127 solved the issue. Be safe, unless you are sure of your particular release... stick to a limit of 127.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With