Strange behavior of read file
Justin Whear
justin at economicmodeling.com
Tue Aug 27 15:57:55 PDT 2013
On Wed, 28 Aug 2013 00:51:12 +0200, Ramon wrote:
>
> - trying with filename r"~/text.txt" (i.e. an existing file in my home
> dir) it FAILED.
>
> - trying with the same filename but this time home dir explicitely
> written out fully (r"/home/me/test.txt) it WORKED.
>
> Conclusion: I assume D's OS path related mechanisms to be somewhat dumb.
> Anyway the code throws where it's supposed to, i.e. when confronted with
> a non existing (or not recognized?) path.
You need to use the expandTilde function: http://dlang.org/phobos/
std_path.html#.expandTilde
More information about the Digitalmars-d-learn
mailing list