error with reading file name
Suliman
evermind at live.ru
Thu Dec 6 07:52:20 PST 2012
I am trying to create simple app that would read user input and
open file with such name, but every time when I run it's crash
with error
"std.file.FileException at std\file.d(294): \1.txt"
import std.stdio;
import std.string;
import std.file;
void main()
{
string getfilename()
{
auto name = readln();
writeln(name);
if (exists(name))
{
writeln("exist");
}
else
writeln("not exist");
return name;
}
void readfile(string name)
{
auto filearray = read(name);
writeln(name);
writeln(filearray);
}
readfile(getfilename());
}
More information about the Digitalmars-d-learn
mailing list