LDraw.org Discussion Forums

Full Version: Lower-casing the library
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
My attention was drawn to this topic by a post by Sylvain Sauvage on LeoCAD list:
Code:
I just realized that Leocad tries to open “ldconfig.ldr”.
The problem is the file is named “LDConfig.ldr” so it’s not
found on case-sensitive filesystems (that means about every
decent FS ;o).
Not a big problem as the default color palette is up to date
but, still, worth knowing IMHO.
Code:
[quote]
I thought all files in the LDraw library were supposed to be lower case.
[/quote]
  Parts files and directories are. LDConfig.ldr isn’t. (And .txt files aren’t either.)
  I didn’t find any reference to case sensitivity in the LDR file format. I only found that for the Official Library
(http://www.ldraw.org/article/512.html):
  “While both upper and lower case letters are permitted in  filenames, filenames are case-insensitive. Currently, all
   official parts are issued with upper-case only names.”
and that is contradicted by the fact that the ZIP file uses lower-case only names.

  Plus, “internally,” the library isn’t consistent, .dat files refer to others as:
— low.dat
— UP.DAT
— UP.dat
— low.DAT
— and a few have MiXeD-cAsE references
I think we should do something to clean up this in library, and also correct article 512...
That would be a good idea.
As you know LDraw references are case insensitive as far I know this includes the reference to LDConfig.ldr.

Does LeoCAD handle all references by simply lower casing them? if so lowercasing the library will not fix all possible problems.

The only way it will be fixed for real, imho, is if LeoCAD did real caseinsensitve lookups.
Lower case is a good idea. I just noticed the same problem in a unrelated project.
Not sure what you mean with this?
I meant to say that the case shouldn't matter from LeoCAD's point of things as the references should be handled case insensitive anyway.

But I misread your main point on the default casing of official files.

On that I agree it should be all lower case all the time as all caps is very ugly especially for extensions. Could it be possible that the 512 article is just an typo as I can't remember ever seeing all caps in official files.

As for LDConfig.ldr I think we should keep that case unchanged as it is an configuration file with known casing probably hardcoded in some programs here and there.
Roland Melkert Wrote:On that I agree it should be all lower case all the time as all caps is very ugly especially for extensions. Could it be possible that the 512 article is just an typo as I can't remember ever seeing all caps in official files.

If you mean
LDraw.org Wrote:All files in the LDraw Parts Library are required to carry the .DAT extension.
then I think this is a typo, because later in the same article it uses .dat
It's trivial to program for case insensitivity and decent programs account for this. The official library standard implies it for filenames so maybe we should revise the file spec to require it as well. Also, I might point out that LeoCAD is not an LDraw compatible program but merely has the ability to import LDraw files.
Agreed, but for the sake of homogeneity I would like too to see the whole parts library converted to lower case (file name and references). But Roland has a point with LDConfig.ldr that has always been capitalized this way.

Quote:Also, I might point out that LeoCAD is not an LDraw compatible program but merely has the ability to import LDraw files.
Used to be true in a time when LeoCAD used its own library file format, but that's no longer the case, LeoCAD now uses plain LDraw library (either zipped or in a folder).
Actually, that's not exactly true. It's not rocket science, but it's also not as trivial as one might imagine. Additionally, LDView runs significantly slower when the LDraw library is installed on a case-sensitive filesystem, because you have to actually search for the right file after the initial open attempt fails.
Pages: 1 2