getcwd C function
Nicholas Kingsley (2769) 31 posts |
I have noticed that the getcwd function with SharedUnixLibrary returns a non-RISCOS compliant directory structure. I use : temp=(char *) SDL_malloc(size); return temp; and the returned path is : /HostFS::HostFS.$/Public/Programming/C/Triority/Source |
Jeffrey Lee (213) 6048 posts |
Programs built using Unixlib use unix-style filenames by default. You should be able to override the behaviour by declaring and initialising the global #include <unixlib/local.h> int __riscosify_control = __RISCOSIFY_NO_PROCESS | __RISCOSIFY_NO_REVERSE_SUFFIX; The unixlib/local.h header is located at !GCC.arm-unknown-riscos.include.unixlib.h.local, and contains an explanation of the different options. Note that although |
Nicholas Kingsley (2769) 31 posts |
That seems to be better – thanks. |
Ronald May (387) 407 posts |
/HostFS::HostFS.$/Public/Programming/C/Triority/Source That looks quite normal for unixlib, it does work internally with unix paths and when encountering RISC OS it has to convert them for use. The riscosification of paths is only to be user friendly at the stdout/stdin, but ports can be used from the CLI in the unix format equally. Steps can be taken to alter the behaviour, but the standard usually works OK. |
Nicholas Kingsley (2769) 31 posts |
Yes, what was happening is that instead of creating a directory of x and then y, it was creating a directory of x/y… |