- heres my code:
(src and dst are valid destinations("/shared2/wc24/misc.bin", "/misc.bin"), Exists returns x>=0)
- ISFS_Initialize();
- s32 fd=ISFS_Open(src, ISFS_OPEN_READ);
- s32 retr;
- u8 *buffer;
- if (Exists(fd)) {
- buffer=(u8*)memalign(32, 0x400);
- retr=ISFS_Read(fd, buffer, 0x400);
- }
- else {
- return "I/O error.";
- }
- fatInitDefault();
- ISFS_Close(fd);
- std::ofstream bufo(dst, std::ios::binary);
- bufo << buffer;
- bufo.close();
EDIT: Moved thread to appropriate sub forum.
Here's a list of ISFS (IOS) error returns you could use to see what the exact issue is on any ISFS call.
https://www.wiibrew.org/wiki//dev/fs Scroll down to /dev/fs error codes
Also a plain jane ISFS_Read call returns the amount of bytes read (dumped to memory). It should always match the 3rd arg/parameter of when you called ISFS_Read.