Unable to open filename passed as command line argument

Curious curiour at home.com
Thu Sep 3 22:45:34 UTC 2020


On Thursday, 3 September 2020 at 11:12:49 UTC, user1234 wrote:
> On Thursday, 3 September 2020 at 10:47:04 UTC, Curious wrote:
>
> otherwise what you get as args are D dynamic arrays (a payload 
> made of .ptr and .length) so you can use std.file or std.stdio 
> to open a file using the "D main" arguments (it's not the like 
> "C main").
>
> ---
> void main(string[] args)
> {
>     import std.stdio;
>     File f = File(args[1], "r");
> }
> ---

Okay. Got it!

Thanks


More information about the Digitalmars-d-learn mailing list