refuses to open file

John Colvin john.loughran.colvin at gmail.com
Wed Apr 17 03:44:44 PDT 2013


On Wednesday, 17 April 2013 at 01:41:58 UTC, 
rbtwms at paradiseca.com wrote:

> File efile;
> writefln("command line %s", args[]);
>
>     if(args.length == 3) {
>         type = to!int( args[1] );
> //      writefln("args[2] is: %s",args[2]);
>     }
>     if (args.length == 2) {
>         efile = File(args[2]);
>     }
>     if (args.length == 1) {
>         efile = File("key"); // I moved file to dir the program 
> is in
>     }

> orignal just had a line  efile = File("l:\\mvammach\\key");
> command line ["eqipfile"]
> std.exception.ErrnoException at std\stdio.d(289): Cannot open file 
> ` KEY ' in
> mode `rb' (No such file or directory)
	
A couple of things:

>     if (args.length == 2) {
>         efile = File(args[2]);
>     }
If args.length == 2 then args[2] doesn't exist.

> command line ["eqipfile"]
I don't understand where this is from...


More information about the Digitalmars-d-learn mailing list