• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Maximum file name length?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Maximum file name length?


  • Subject: Re: Maximum file name length?
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 15 Nov 2005 23:46:39 +0000

On 15 Nov 2005, at 02:09, email@hidden wrote:

I've searched the archives and found questions without answers. I've searched the documentation and learned nothing.

How do I know what the maximum allowed filename length is for a given file system?

As someone else pointed out, you can use pathconf() if you really need this information. However, it's best not to make any assumptions about the maximum lengths of filenames or pathnames, because doing so only causes problems when those assumptions turn out not to be correct.


I would recommend that you don't make any assumptions, and just code your application as if there is no limit on filename lengths. You might be able to justify limiting the length of a filename or pathname in a GUI field, but it will be tricky to get this exactly right because of things like mount points, symbolic links and aliases (for instance, you can't rely on things being on the same filesystem just because they start with the same /Volumes/<whatever>/).

Kind regards,

Alastair.

--
www.alastairs-place.net


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Maximum file name length? (From: email@hidden)

  • Prev by Date: Re: Reference to entity name in NSPredicate?
  • Next by Date: Re: Reference to entity name in NSPredicate?
  • Previous by thread: Re: Maximum file name length?
  • Next by thread: Re: Maximum file name length?
  • Index(es):
    • Date
    • Thread