LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-18-2007, 07:19 AM   #1
unkie888
Member
 
Registered: Aug 2007
Posts: 67

Rep: Reputation: 24
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!
 
Old 08-18-2007, 07:29 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by unkie888 View Post
..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!!

Last edited by pixellany; 08-18-2007 at 07:31 AM.
 
Old 08-18-2007, 08:00 AM   #3
unkie888
Member
 
Registered: Aug 2007
Posts: 67

Original Poster
Rep: Reputation: 24
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.
 
Old 08-18-2007, 08:07 AM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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!
 
1 members found this post helpful.
Old 08-18-2007, 08:15 AM   #5
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
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
 
Old 08-18-2007, 08:22 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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.
 
Old 08-18-2007, 08:37 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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.
 
1 members found this post helpful.
Old 08-18-2007, 09:16 AM   #8
unkie888
Member
 
Registered: Aug 2007
Posts: 67

Original Poster
Rep: Reputation: 24
ok, thanks.

so maybe it's possible - but it's a biggy - So I think I'll steer clear.
 
Old 08-18-2007, 08:32 PM   #9
trungnt_hut
Member
 
Registered: Apr 2007
Location: Vietnam
Distribution: Slackware
Posts: 38

Rep: Reputation: 15
Quote:
Originally Posted by unkie888 View Post
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.
 
Old 08-18-2007, 10:43 PM   #10
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
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.
 
  


Reply

Tags
filename


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Longest Uptime for Linux, yours not somebody else's. dalek Linux - General 61 05-10-2013 10:50 PM
Convert static library (Filename.a) to dynamic shared object (filename.so) afx2029 Linux - Software 4 08-17-2007 06:07 AM
Longest filename in a directory dresch Linux - Newbie 6 01-05-2007 03:29 PM
Longest thread. User Name. General 6 09-05-2006 12:48 AM
Longest line in C thinkgeek Programming 4 08-23-2005 12:06 PM


All times are GMT -5. The time now is 06:22 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration