Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File spec. size 1

Status
Not open for further replies.

Bobby2004

Programmer
Mar 10, 2004
82
IN
How big a buffer should be provided for file names including fully qualified path for portability under all versions of Windows. Is there any constant
available in the Windows SDK for this?
 
Thanks. But I have one doubt - is this including the file name or not?
 
But the max for long file names is 256(?) so that leaves only 4 for path?
 
Yes I am sure. The whole file name (including path) cannot exceed 260 characters. If you create a file with long name (say 256 characters) you cannot move it in a deeper folder tree. It can only be created on the root directory. If you try move the file to a folder and the whole file name and path exceeds the limits, Windows denies this attempt and throws a file system error.

The complete file name together with the path MUST not exceed the MAX_PATH limit. This also includes the two spaces reserved for enclosing quotes (") used by Windows which means that the maximum limit to file name and path is 258 characters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top