I am trying to create a file in ~/.config
My code is:
[code]
import std.stdio;
void main()
{
auto f = File("~/.config/minas.txt", "w");
}
[/code]
However, an exception is thrown.
std.exception.ErrnoException@std/stdio.d(288): Cannot open file
`~/.config/minas.txt' in mode `w' (No such
Try using the $HOME environment variable.
Use std.path.expandTilde() ->
http://dlang.org/phobos/std_path.html#expandTilde
On 13.4.2012 18:02, Minas wrote:
> I am trying to create a file in ~/.config
> My code is:
>
> [code]
> import std.stdio;
>
> void main()
> {
> auto f = File("~/.config/minas.txt", "w");
> }
> [/code]
>
> Howeve
On Friday, 13 April 2012 at 16:41:01 UTC, Bystroushaak wrote:
Use std.path.expandTilde() ->
http://dlang.org/phobos/std_path.html#expandTilde
Thank you very much! That did the trick!
auto f = File(expandTilde("~/.config/test.txt","w"));