PS2 Strange behaviour in remove() and unlink()

JMGK

Developer
Hi,

I am having a strange behavior when deleting a file from memory card. I open, create files, read and write them, etc... But when i try to delete any file, the file is deleted but a folder with same name is created (!).

In my code:

remove("mc0:BARULAND/08040336.PNG");​

In PCSX2 log, i get:

remove file mc0:BARULAND/08040336.PNG
mkdir name mc0:BARULAND/08040336.PNG​

It happen both in a real PS2 and in PCSX2, what make me believe is a problem in stdlib. I looked in ps2dev/libs/ps2sdk/iop/system/iomanx/src/iomanX.c, trying to find a missing 'break' in a switch/case or the like, but found nothing.

Anybody had noticed anything similar?
 
Last edited:
Hi,

I am having a strange behavior when deleting a file from memory card. I open, create files, read and write them, etc... But when i try to delete any file, the file is deleted but a folder with same name is created (!).

In my code:

remove("mc0:BARULAND/08040336.PNG");​

In PCSX2 log, i get:

remove file mc0:BARULAND/08040336.PNG
mkdir name mc0:BARULAND/08040336.PNG​

It happen both in a real PS2 and in PCSX2, what make me believe is a problem in stdlib. I looked in ps2dev/libs/ps2sdk/iop/system/iomanx/src/iomanX.c, trying to find a missing 'break' in a switch/case or the like, but found nothing.

Anybody had noticed anything similar?
I had this issue when using fio functions about a year ago I think? Anyway loading a sbv patch fixed it, maybe try that.


Quote from sp193:
run the sbv_patch_fileio() patch first.
This will also fix fioGetstat() and fioDread().
 
Back
Top