LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   longest linux filename (https://www.linuxquestions.org/questions/linux-newbie-8/longest-linux-filename-577990/)

unkie888 08-18-2007 07:19 AM

longest linux filename
 
Hi,

Just by experimentation I have worked out that a filename in linux cannot have more than 255 chars.

Is this softcoded - and if so;

1) where?

2) would it be wise for me to increase this?

thx!

pixellany 08-18-2007 07:29 AM

Quote:

Originally Posted by unkie888 (Post 2862941)
..filename in linux cannot have more than 255 chars.
2) would it be wise for me to increase this?

Why would you need to increase it??? What does an "ls -l" listing look like if all the filenames are even 100 characters? Yuk!!

unkie888 08-18-2007 08:00 AM

Quote:

Why would you need to increase it???
does it matter?

because I want longer filenames. :)


Specifically, Windows allows 255 character filenames.

I pass the files to Linux.

I then try to run SVN to import the files.

SVN wants to add 9 characters '.svn-base' to the end of the file.

Can't open file 'Home/xapp7/.svn/text-base/THE_VERY_LONG_FILENAME_HERE.xp.svn-base': File name too long

I can't control the length of the supplied files.

If only I could extend linux filenames by 10 chars, i could be confident of covering any file.


However I can see this coming up in other scenarios... so... the question remains -- is it softcoded or are both Operating Systems limited to 255?

many thanks.

colucix 08-18-2007 08:07 AM

Filename length is a feature of the filesystem. And on most *nix filesystem the maximum length allowed is 255 bytes, that is 255 1-byte chars. I'm afraid you have not a chance! ;)

stress_junkie 08-18-2007 08:15 AM

Please don't post the same (or basically the same) post more than once.

http://www.linuxquestions.org/questi...d.php?t=577990

http://www.linuxquestions.org/questi...d.php?t=577995

pixellany 08-18-2007 08:22 AM

It appears to be a function of the filesystem:
http://en.wikipedia.org/wiki/Compari...systems#Limits
Note that Reiser seems to have a higher limit than most of the others

Based on a quick glance "man tune2fs", it seems not to be a settable option for ext2/ext3.

druuna 08-18-2007 08:37 AM

Hi,

I've read that ext2/ext3 and reisefs are max 255 by default but can be extended to 1012.

How to do this is harder to come by. This I come across regularly:
Quote:

Ext2fs provides long file names. It uses variable length directory
entries. The maximal file name size is 255 characters. This limit
could be extended to 1012 if needed.
But I cannot seem to find a document that describes how/where to do this. I assume that this has to be done during compilation.

unkie888 08-18-2007 09:16 AM

ok, thanks.

so maybe it's possible - but it's a biggy - So I think I'll steer clear.

trungnt_hut 08-18-2007 08:32 PM

Quote:

Originally Posted by unkie888 (Post 2862959)
does it matter?
Specifically, Windows allows 255 character filenames.

As I remember, Windows allows 255 character filenames but it only distinguish the 1st 62 or 63 character.

Matir 08-18-2007 10:43 PM

I believe the "could be extended to 1012" would be based on a modification of the filesystem and filesystem code: i.e., beyond 1012 the data would be too large to fit in the space designated for a single file entry in the filesystem.


All times are GMT -5. The time now is 09:23 PM.