identify too long directory names and file names

Community Forums/General Help/identify too long directory names and file names

RemiD(Posted 2015) [#1]
Hello,

As you may know, when you burn a DVD, there is a limit of characters in each directoryname and in each filename and in each pathname

Apparently the limit of characters is 255 for a DVD.

My question : If i want to code a tool to analyze the lengthes of all directories names and of all files names and of all paths names in order to identify which total lengthes (pathname+filename) are too long, is it as simple as counting the numbers of characters in each directory name, in each file name, to calculate the total length (pathname+filename) ?

Or is there anything else to consider ?

Thanks,


Yasha(Posted 2015) [#2]
The UDF filesystem specification can be read here: http://www.osta.org/specs/pdf/udf102.pdf

No idea what most of it means, but at the start of section 2 there's a table with basic restrictions: the maximum length of a filename is 255 bytes, and the maximum length of a complete path is 1023 bytes. Section 2.3.12.1 says the maximum length of a path component is also 255 bytes, whatever that is.

Since these sizes are measured in bytes, not characters, you don't need to worry about counting Unicode letters or annoyingly difficult things like that. Just measure the size of the buffer (or in Blitz3D, which only supports ASCII for built-in operations anyway, just take the length of the string).


RemiD(Posted 2015) [#3]
@Yasha>>Thanks for the link


Also some infos here :
https://social.technet.microsoft.com/Forums/windows/en-US/c69ce386-e3b9-4f49-8020-6c05219eff62/file-name-too-long-can-not-burn-win-7-into-dvd

There's a limitation of the file system. It can only handle file names of a certain length. Technically the same is true on HD, USB drives and DVDs etc.
Path limit is 248 characters.
Path+Filename limit is 260 characters.




virtlands(Posted 2015) [#4]
This is a free program I found that displays path lengths -- (.. allows you to sort by length too) ::

Path Length Checker -- (includes C# source code)

https://pathlengthchecker.codeplex.com/




xlsior(Posted 2015) [#5]
Section 2.3.12.1 says the maximum length of a path component is also 255 bytes, whatever that is.


I'd assume they mean the length of each foldername in your path.

e.g.

FolderA\FolderB\\FolderC\FolderD\FolderE\Filename

entire string: max length of 1023
filename: max length of 255
Each foldername: max length of 255


RemiD(Posted 2015) [#6]
@virtlands>>i have seen this tool but i don't trust a tool from an unknown dev to analyze my files, maybe i should ? I don't know... I prefer to code my own tool for this.

I will probably code my own tool but by curiosity : if i disallow all connections from my computer to the internet from this tool (with the firewall), do you think this tool can be safe to use ? (with personnal files)