Trouble Migrating from Windows to Linux

Brian Budge brian.budge@gmail.com
Sat May 16 20:55:00 GMT 2009


In Linux, you can use the glob/wordexp functions for this, or do it
yourself with getenv.

On Sat, May 16, 2009 at 11:35 AM, Ian Lance Taylor <iant@google.com> wrote:
> James Cobban <jamescobban@sympatico.ca> writes:
>
>> while on Linux it reads:
>>       "~/Windows/Archives/Database/SubDistTable1881.csv"
>> and writes to:
>>       "~/Windows/Archives/Database"
>
> Note that on Linux/Unix the name "~" is not special when you call open
> or fopen or similar functions.  The name "~" is expanded by the shell;
> specifically an unquoted ~ at the start of a pathname, followed by a /,
> is replaced by the contents of the environment variable HOME, or, if
> HOME is not set, by the home directory of the user executing the shell.
> If you are not using the shell, you need to expand "~" yourself.
>
> Ian
>



More information about the Gcc-help mailing list