[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Strange getcwd() return value



On 10/16/13 20:28, Jean-François Lemaire wrote:
On Wednesday 16 October 2013 20:02:36 Alan Hourihane wrote:
On 10/16/13 19:31, Jean-François Lemaire wrote:
A test case would be useful, but are you mixing GEMDOS directly with
mintlib calls as using mintlib
exclusively is meant to be able to translate these names.
Yes, I'm mixing GEMDOS and mintlib calls.
Then, I think that's going to fail.
OK. To be clearer, I was trying to open a file with fopen() in the current
working directory. Since the file is there but fopen() failed, I checked the
path with getcwd() and the bogus return value explained why fopen() failed.
However, the GEMDOS call Dgetcwd() gives the correct working directory.

So, to sum up, is it possible that the current working directory of an
application is different for GEMDOS and the mintlib?

The path may look different, but feeding a path retrieved via the mintlib
back to mintlib should work. Feeding a path got from GEMDOS back to
GEMDOS obviously works. Feeding a path from mintlib back to GEMDOS
will fail because of this.

Right or wrong, this is how it's been done. It's all fixable if we need it to be
though.

So, back to a testcase, and what was the error code of fopen() ?

Alan.