×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Maximum Filename Characters for zippping

Maximum Filename Characters for zippping

Maximum Filename Characters for zippping

(OP)
Can anyone tell me what is the maximum number of characters there can be in a file name when zipping it?

RE: Maximum Filename Characters for zippping

Looking at the file format, the file name length field in the header is only two bytes.  So making a wild guess I would say the maximum file name itself would have to be 255 char. (Purely a guess.)

http://en.wikipedia.org/wiki/ZIP_%28file_format%29
 

Jeff
It's never too early to begin preparing for International Talk Like a Pirate Day
"The software I buy sucks,  The software I write sucks.  It's time to give up and have a beer..." - Me

RE: Maximum Filename Characters for zippping

..or possibly 65535 (2 bytes = 2^16 or 65536, losing the possibility of 0 length name)

If you want the best response to a question, please check out FAQ222-2244: How to get the best answers first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller  

RE: Maximum Filename Characters for zippping

Yes, 2 bytes unsigned (only positive N) will enable lengths of 65536 at max, if you won't allow 0 length. But what also matters is what file name lengths OSes support. Windows for example will not allow more than 260 chars (MAX_PATH), even though NTFS itself allows longer names. I don't know the reasoning, legacy software support most probably, or concerns about viruses hiding in lengthy folder strtucutres manually hardly reachable.

ZIP of course is not limited to Windows usage, but as Linux rather uses .gzip or .bzip and MacOS .sit (I think) it will not have much of an impact, that ZIP supports longer names.

Bye, Olaf.

 

RE: Maximum Filename Characters for zippping

(OP)
Thanks for your replies, but I am looking for the NUMBER OF CHARACTERS.  Like there used to be 8.3; or now you can name a file with a max of 255 characters.  I did a zip one time and it would not let me because the file names were too long.

RE: Maximum Filename Characters for zippping

Characters = bytes/2 in mosta any case. So the OS limit of 260 CHARS is mostly the limiting factor.

Quote (tkambui):


 I did a zip one time and it would not let me because the file names were too long.

What was the source of zipping? What file system? Eg even on Windows, a CD typically has the Joilet Filessystem, this allows less, Linux allows many file systems which allow longer names.

No Windows Path can break that limit, but perhaps the ZIP software you used has another limit on top of the file sepcification limit.

Bye, Olaf.

RE: Maximum Filename Characters for zippping

Some zip programs count the entire path (drive letter, directory path, and full file name) as the length of the file name. If you have something buried deep in some long named directories, it can add up and cause a failure.

 

RE: Maximum Filename Characters for zippping

Yes, Sam, that's true. Mostly you would rather zip a dir and then only subdirs would add up to more lengthy names, still I see no way to get too long names in any windows dir, even if you zip a drive from it's root, you rather will break other limits, eg file length of the resulting zip archive.

Bye, Olaf.

RE: Maximum Filename Characters for zippping

(OP)
I used WinZip on an XP machine and I'm thinking that the entire path was being counted.  Thanks for all the replies.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close