Windows to Linux Porting
Vino
vino.bheeman at hotmail.com
Fri May 4 03:30:29 UTC 2018
Hi All,
Request you help on the below code, the below code always state
the file does not exist even if the file do exist.
Code:
import core.stdc.stdlib: exit;
import std.stdio;
import std.file;
import std.path;
auto osSwitch () {
string ConfigFile;
version (Windows) { ConfigFile = absolutePath(`.\nasconfig.txt`);
} else version (Linux) { ConfigFile =
absolutePath(`nasconfig.txt`); }
return ConfigFile;
}
void main () {
auto ConfigFile = osSwitch;
if (!ConfigFile.exists) { writeln("The Configuration File ",
buildNormalizedPath(ConfigFile), " do to exist, Terminating the
execution.."); exit(-1);}
else { writeln(ConfigFile); }
}
From,
Vino.B
More information about the Digitalmars-d-learn
mailing list