Creating a file in ~/.config (ubuntu)

2012-04-13 Thread Minas
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

Re: Creating a file in ~/.config (ubuntu)

2012-04-13 Thread Kevin Cox
Try using the $HOME environment variable.

Re: Creating a file in ~/.config (ubuntu)

2012-04-13 Thread Bystroushaak
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

Re: Creating a file in ~/.config (ubuntu)

2012-04-13 Thread Minas
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"));