Menu

#1 Case sensitivity in Linux causes problems loading

open
nobody
Loader (1)
5
2007-01-23
2007-01-23
No

Because Linux is case sensitive, the Loader can run into trouble. Changing the setBaseUrl(URL) and resolve(String) methods fixes the problem. Sorry for not submitting a formal patch, but hopefully the following helps someone else:

In setBaseUrl(URL), in the initial try block:

ldrawP = new URL(url, "p/");
if (!new File(ldrawP.getFile()).exists()) {
ldrawP = new URL(url, "P/");
}
ldrawParts = new URL(url, "parts/");
if (!new File(ldrawParts.getFile()).exists()) {
ldrawParts = new URL(url, "PARTS/");
}
ldrawModels = new URL(url, "models/");
if (!new File(ldrawModels.getFile()).exists()) {
ldrawModels = new URL(url, "MODELS/");
}

In resolve(String), right before throwing the FNF

int mark = urlFile.indexOf("/");
if (mark > 0) {
String parent = urlFile.substring(0, mark);
String target = urlFile.replace(parent, "");

resolved = resolve(ldrawBase, parent.toUpperCase() + target);
if (resolved != null)
return resolved;

resolved = resolve(ldrawBase, parent.toLowerCase() + target);
if (resolved != null)
return resolved;
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.