Yes, these are all working as expected
indeed, no complains for these.
2. "./test.txt" gives "host0:/TEST/host0:./test.txt" WRONGGG!
I don't believe this -- it works fine in my tests, and returns "host0:/TEST/test.txt"
it was the very first test I've made, as I use this a lot, and was amazingly surprised it worked opening a file specifying the relative path, but gave a strange result expanding it.
I'll try it again for sure, maybe today if my little baby falls to sleep a couple of hours in the afternoon... ;-)
Relative paths with a drive specification won't work. There's no concept of a "relative path on a drive" because unless you've actually switched your working directory over to that drive, there's nothing for it to be "relative" to. This could be extended to handle the case where the drive is the same as the cwd drive, but adding special cases is weird and I think the format "drive0:relativepath" just shouldn't be used.
From the PSP's libc point of view, valid paths are:
- full absolute path with drive
- full absolute path without drive:
- relative path without drive:
and these will all get normalized correctly. Feel free to post a patch extending the format to other varieties, but you'll have to convince us that they make sense.
ok, I see, and was actually thinking what the concept of relative paths across drives should be.
I think I've been teached wrongly... and still pretend to use these ugly things ;-) in the old DOS days, where you could do a
Code: Select all
"CD D:\TEST\FIRST"
"CD E:\DATA\SAVES"
and then use relative paths just with "D:testfile.txt" or "E:1001.dat". Expanding them resulted accordingly to the "cwd" of each drive.
Maybe this gets no sense at all, since on the PSP (and in Linux, even if no concept of drive applies) cd-ing to a different path simply makes it the cwd, and you cannot switch among paths unless you do a new cd, and thus changing the cwd that would explode the relative path.
I'm going to consider only the valid specs from libc, and eventually fix the (according to my tests) wrong behaviors.
Then, if it is allcorrect and makes sense, we can think about a patch.
Thanks all for following me along the "path" ;-)
Have you all a nice day.
Cheers, A.