Skip to content
Snippets Groups Projects
Commit 67354173 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add better error reporting when listfile can't be found on disk

For Dumas Walker (CAPCITY2)
parent a987cf4b
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
Pipeline #6251 passed
...@@ -180,9 +180,16 @@ for(var d = 0; d < dir_list.length; d++) { ...@@ -180,9 +180,16 @@ for(var d = 0; d < dir_list.length; d++) {
var listpath; var listpath;
if(listfile) { if(listfile) {
listpath = file_getcase(dir.path + listfile) || file_getcase(listfile); if(file_getname(listfile) == listfile)
var f = new File(listpath); listpath = dir.path + listfile;
if(f.exists) { else
listpath = listfile;
var realpath = file_getcase(listpath);
if(!realpath) {
alert(listpath + " does not exist");
continue;
}
var f = new File(realpath);
writeln("Opening " + f.name); writeln("Opening " + f.name);
if(!f.open('r')) { if(!f.open('r')) {
alert("Error " + f.error + " (" + strerror(f.error) + ") opening " + f.name); alert("Error " + f.error + " (" + strerror(f.error) + ") opening " + f.name);
...@@ -190,10 +197,6 @@ for(var d = 0; d < dir_list.length; d++) { ...@@ -190,10 +197,6 @@ for(var d = 0; d < dir_list.length; d++) {
} }
file_list = parse_file_list(f.readAll()); file_list = parse_file_list(f.readAll());
f.close(); f.close();
} else {
alert(dir.path + file_getname(listfile) + " does not exist");
continue;
}
} }
else { else {
var list = directory(dir.path + '*'); var list = directory(dir.path + '*');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment