Re: readText fails to open file

2012-06-17 Thread GreatEmerald
On Sunday, 17 June 2012 at 08:35:58 UTC, Jonathan M Davis wrote: Also, you need to check exists before you check isFile, otherwise isFile will blow up if the file doesn't exst. And both of those are properties, so you should be calling them like auto filename = args[1]; if(!filename.exists ||

Re: readText fails to open file

2012-06-17 Thread GreatEmerald
Oh, I just figured out what was going wrong. Apparently, args[0] is the path to the program itself, and not the first argument. args[1] is what I need to start reading from!

Re: readText fails to open file

2012-06-17 Thread Jonathan M Davis
On Sunday, June 17, 2012 10:21:17 GreatEmerald wrote: > This is kind of silly, and I probably missed something, but for > some reason I can't get any kind of text file opened when using > readText from std.file. This is what I'm trying to do: > >import std.stdio; >import std.file; > >

Re: readText fails to open file

2012-06-17 Thread Ali Çehreli
On 06/17/2012 01:21 AM, GreatEmerald wrote: This is kind of silly, and I probably missed something, but for some reason I can't get any kind of text file opened when using readText from std.file. This is what I'm trying to do: import std.stdio; import std.file; int main(string[] args) { if (!is

Re: readText fails to open file

2012-06-17 Thread Dmitry Olshansky
On 17.06.2012 12:21, GreatEmerald wrote: This is kind of silly, and I probably missed something, but for some reason I can't get any kind of text file opened when using readText from std.file. This is what I'm trying to do: import std.stdio; import std.file; int main(string[] args) { if (!isFil

readText fails to open file

2012-06-17 Thread GreatEmerald
This is kind of silly, and I probably missed something, but for some reason I can't get any kind of text file opened when using readText from std.file. This is what I'm trying to do: import std.stdio; import std.file; int main(string[] args) { if (!isFile(args[0])) {