Lower-casing the library - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: General (https://forums.ldraw.org/forum-12.html) +--- Forum: Official File Specifications/Standards (https://forums.ldraw.org/forum-32.html) +--- Thread: Lower-casing the library (/thread-17235.html) |
Lower-casing the library - Philippe Hurbain - 2015-09-15 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”. Code: [quote] Re: Lower-casing the library - Damien Roux - 2015-09-15 That would be a good idea. Re: Lower-casing the library - Roland Melkert - 2015-09-15 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. Re: Lower-casing the library - Michael Horvath - 2015-09-16 Lower case is a good idea. I just noticed the same problem in a unrelated project. Re: Lower-casing the library - Philippe Hurbain - 2015-09-16 Not sure what you mean with this? Re: Lower-casing the library - Roland Melkert - 2015-09-16 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. Re: Lower-casing the library - Chris Dee - 2015-09-16 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 Re: Lower-casing the library - Orion Pobursky - 2015-09-17 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. Re: Lower-casing the library - Philippe Hurbain - 2015-09-17 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). Re: Lower-casing the library - Travis Cobbs - 2015-09-18 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. Re: Lower-casing the library - Sylvain Sauvage - 2015-09-18 Roland Melkert Wrote:As you know LDraw references are case insensitiveDe facto, yes. De jure, as I was saying in what Philo quoted, since the 8.3 MSDOS restrictions were dropped, it’s not written anywhere. Re: Lower-casing the library - Sylvain Sauvage - 2015-09-18 Orion Pobursky Wrote:It's trivial to program for case insensitivity Of the programs I have access to the code: LPub: Reads “as-is.” When adding paths, it thinks all directories names of LDraw are lowercase. Sum-up: trivially fails (as a lot of .dat don’t refer to others in all-lowercase). LDView: Tries all-lower, then all-upper, then as-is, then fails. The filenames include the paths. So if the files are somewhere like ~/Documents/LDraw/…, only the as-is versions could be found. A lot of LDraw official parts wouldn’t because of the internal mess of the library. Sum-up: trivially fails. LeoCAD: Reads the parts.lst or all the .dat, stores the model-names in all-upper. It’s okay because, even if it thinks that all directories and files’ names of LDraw are lowercase (which is only false for LDConfig.ldr), it doesn’t touch the library’s path. Sum-up: works (except for LDConfig.ldr, for now). For the other main programs I know of (MLCAD, LDCAD, etc.), either they are Windows only, and the question doesn’t arise (ditto in Wine), or closed-source, and I won’t know. Orion Pobursky Wrote:and decent programs account for this. So, either it’s not so trivial or LDView, LPub and LeoCAD are not decent programs. I’m sure their developers would be happy to know that. Orion Pobursky Wrote:The official library standard implies it for filenames so maybe we should revise the file spec to require it as well. Yes, it’s trivial to write a specification that says which filenames are case sensitive and which aren’t and eases the programmers’ job of finding those files. Orion Pobursky Wrote:Also, I might point out that LeoCAD is not an LDraw compatible program but merely has the ability to import LDraw files. As another answer says, that is not true anymore since several versions (even the output format has changed from ad-hoc-binary to LDR-with-comments). But the fact that the problem was raised on the LeoCAD list is not pertinent to the question. Indeed, LeoCAD is the only one of the three I talked supra that has no problem finding .dat files as they are distributed now. The problem raised on the LeoCAD list was only about its assumptions about LDConfig.ldr. The state of the library was a follow-up. Sorry if my tone is harsh but “we don’t care about programs and systems we don’t use” is rude too. Re: Lower-casing the library - Sylvain Sauvage - 2015-09-18 Chris Dee Wrote:If you meanLDraw.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 The 512 article says just above the .DAT (my emphasis): Quote: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. Re: Lower-casing the library - Roland Melkert - 2015-09-18 Sylvain Sauvage Wrote:For the other main programs I know of (MLCAD, LDCAD, etc.), either they are Windows only, and the question doesn’t arise (ditto in Wine), or closed-source, and I won’t know.LDCad does full path case insensitive lookups in both the Windows and Linux versions. This is done by caching the file listings of all needed target folders. It is needed even on Windows as it also gives you the correct casing when the reference was wrong. So for example even a reference like: mEsSEd/uP/fILenAme/rEf.dAT will resolve to e.g. messed/up/fileName/ref.dat Only possible problem on case sensitive file systems will be when there are different cased versions of the same file present, in such cases the first one will 'win'. Re: Lower-casing the library - Travis Cobbs - 2015-09-18 Sylvain Sauvage Wrote:LDView: LDView's file case handling is platform-specific. The Qt version should support any file case (unless the implementation is buggy), is written using Qt filesystem classes, and is slow. The Qt code is in ModelViewerWidget:taticFileCaseCallback(). The other versions (including the OSMesa version) don't properly support arbitrary case on a case-sensitive file system. Re: Lower-casing the library - Sylvain Sauvage - 2015-09-18 Yes, sorry, I hadn’t tracked the setting of the callback (and the callback code). So, I amend with: LDView: Tries all-lower, then all-upper, then as-is, then globbing. Sum-up: wonderfully not trivial. And not fast. Re: Lower-casing the library - Nathanel Titane - 2015-09-19 Well not to mention that I ran into this issue with LDConfig.ldr at some point when using both LDView and ldview: things weren't functioning as the utilities weren't functioning properly due to the file's upper case naming scheme. I personally have mine lower case on my system (Linux) and have kept it that way ever since. Since the DOS spec is no longer relevant and since case specific lookups are a hassle, it would definitely be a good idea to brush up the spec to have the library go lower case or insensitive. |