RosettaCodeData/Task/Check-that-file-exists/D/check-that-file-exists.d
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

18 lines
385 B
D

import std.stdio, std.file, std.path;
void verify(in string name) {
if (name.exists())
writeln("'", name, "' exists");
else
writeln("'", name, "' doesn't exist");
}
void main() {
// check in current working dir
verify("input.txt");
verify("docs");
// check in root
verify(dirSeparator ~ "input.txt");
verify(dirSeparator ~ "docs");
}