/dev/fs: Difference between revisions

From WiiBrew
Jump to navigation Jump to search
Dasda (talk | contribs)
No edit summary
Henke37 (talk | contribs)
m categories
Line 142: Line 142:
|- style="background-color: #ddd;"
|- style="background-color: #ddd;"
|}
|}
[[Category:IOS API documentation]] [[Category:API documentation that doesn't explain how to use the API]] [[Category:API documentation that forgets to actually document the API]]

Revision as of 22:37, 21 March 2008

The filesystem can be directly accessed through "/dev/fs".

There are several IOS functions for FS like Delete/Create/List/Rename/.. .

Files can be directly opened with IOS_Open("/tmp/data.bin",1);



The root folder looks like that:

/tmp

/meta

/import

/shared2

/shared1

/title

/ticket

/sys

For a more detailed example of how the file system structure can look, see http://www.openwii.org/forums/viewtopic.php?p=1241#1241.

Currently, under the Twilight Hack, we are only able to access /shared2 and the /title folder for the running game, and some contents of /title/00010002 (Wii Hxxx channels). Zelda also has access to some game-saves, depending on the permission flags set by the game.


Ioctl listing

Request number Name input output notes
0x9 CreateFile 0x4C bytes. First 0x40 are used for the filename, 0x40-0x45 are unused,0x46-0x48 unknown but used, 0x49 is used for the attribute, 0x4A-0x4C unused. 0

/dev/fs error codes

Error code POSIX equivalent notes
-1 EACCES Permission denied
-2 EEXIST File exists
-4 EINVAL Invalid argument
-6 ENOENT File not found
-8 EBUSY Resource busy
-12 EIO ? returned on ECC error
-22 ENOMEM Alloc failed during request
-102 EACCESS Permission denied
-103 EIO? returned for "corrupted" NAND
-105 EEXIST File exists
-106 ENOENT File not found
-107 ENFILE Too many fds open
-108 EFBIG? max block count reached?
-109 ENFILE Too many fds open
-110 ENAMETOOLONG pathname is too long
-111 ? FD is already open
-114 EIO? returned on ECC error
-115 ENOTEMPTY Directory not empty
-116 ENAMETOOLONG? max directory depth exceeded
-118 EBUSY Resource busy
-119 ? fatal error