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

Re: [MiNT] Strange getcwd() return value



Am Donnerstag, den 24.10.2013, 21:27 +0200 schrieb Jo Even Skarstein <joska@online.no>:
On Thu, 2013-10-24 at 00:53 +0200, Ole wrote:

However, the question is why you have to calculate/generate a complete path when loading the RSC? rsrc_load("<subdir>\\netsurf.rsc") would in most circumstances be the conventional way to load the rsc, and also the
easiest one.

You can never predict the CWD of a process. <subdir>\netsurf.rsc could be
anything. And relative paths mostly means that OS has to translate
it to an absolute path by using the CWD. (It would be better to use
the directory of the executable, but there is no way in ANSI C to read that
directory!)

Of course it could be possible that the AES is able to absolutize that path
in an correct manner, but I strongly doubt that ;)

Let's assume the following:

cd /usr/src/foobar
/f/netsurf

the CWD is /usr/src/foobar and I bet 5 bucks that the AES fails to resolve <subdir>\netsurf.rsc (because the CWD is /usr/src/foobar). But maybe it fails
because I used / instead of \.

btw. do you see the path: /usr/src/ ?? this would translate
to <whateverdrive>/usr/src in the MiNT view on Filesystems,
which is an totally incorrect thing.
/ must the the root of the unified filesystem. That's the only thing that makes sense.

Greets,
Ole