Difference between revisions of "FS:OpenFile"

From 3dbrew
Jump to navigation Jump to search
 
(11 intermediate revisions by 6 users not shown)
Line 11: Line 11:
 
| Transaction (usually 0)
 
| Transaction (usually 0)
 
|-
 
|-
| 2
+
| 2-3
| Archive handle lower word
+
| u64, Archive Handle
|-
 
| 3
 
| Archive handle upper word
 
 
|-
 
|-
 
| 4
 
| 4
| LowPath.Type
+
| [[Filesystem_services#PathType|Path Type]]
 
|-
 
|-
 
| 5
 
| 5
| LowPath.Size
+
| Path Size (including null-terminator)
 
|-
 
|-
 
| 6
 
| 6
| OpenFlags
+
| [[Filesystem_services#OpenFlags|Open Flags]]
 
|-
 
|-
 
| 7
 
| 7
| Attributes (usually 0)
+
| [[Filesystem_services#Attributes|Attributes]] (usually 0)
 
|-
 
|-
 
| 8
 
| 8
| (LowPath.Size<<14)  <nowiki>|</nowiki> 2
+
| (PathSize << 14)  <nowiki>|</nowiki> 2
 
|-
 
|-
 
| 9
 
| 9
| LowPath.Data pointer
+
| Path Data Pointer
 
|}
 
|}
  
Line 46: Line 43:
 
|-
 
|-
 
| 1
 
| 1
| Resultcode
+
| Result code
|-
 
| 3
 
| File handle
 
|}
 
 
 
=OpenFlags=
 
{| class="wikitable" border="1"
 
|-
 
!  Bit
 
!  Description
 
|-
 
| 0
 
| Read
 
|-
 
| 1
 
| Write
 
 
|-
 
|-
 
| 2
 
| 2
| Create
+
| Move handle descriptor (0x10)
|}
 
 
 
= Attributes =
 
{| class="wikitable" border="1"
 
 
|-
 
|-
!  Flag
+
| 3
!  Description
+
| File client session handle
|-
 
| 0x00000001
 
| Is Read-Only
 
|-
 
| 0x00000100
 
| Is Archive
 
|-
 
| 0x00010000
 
| Is Hidden
 
|-
 
| 0x01000000
 
| Is Directory
 
|}
 
 
 
=LowPath=
 
{| class="wikitable" border="1"
 
|-
 
!  Type
 
!  Description
 
|-
 
| 0 (INVALID)
 
| Specifies an invalid path.
 
|-
 
| 1 (EMPTY)
 
| Specifies an empty path.
 
|-
 
| 2 (BINARY)
 
| Specifies a binary path, which is non-text based.
 
|-
 
| 3 (CHAR)
 
| Specifies a text based path with a 8-bit byte per character.
 
|-
 
| 4 (WCHAR)
 
| Specifies a text based path with a 16-bit short per character.
 
|}
 
 
 
== Binary LowPath ==
 
The format of the data that a binary LowPath points to is custom per archive.
 
 
 
 
 
=== SystemSaveData Archive Path Data Format ===
 
==== FS ====
 
{| class="wikitable" border="1"
 
|-
 
!  Index word
 
!  Description
 
|-
 
| 0
 
| [[Mediatypes|Mediatype]] (must be zero for NAND)
 
|-
 
| 1
 
| saveid
 
|}
 
The file/directory lowpath is a text lowpath in the [[Savegames|savegame]] filesystem.
 
 
 
==== FSPXI ====
 
{| class="wikitable" border="1"
 
|-
 
!  Index word
 
!  Description
 
|-
 
| 0
 
| This u8 is always zero?
 
|}
 
The file lowpath is a binary lowpath containing the u64 saveid, however the high word of the saveid is always zero. The mounted file is the cleartext savegame image.
 
 
 
=== UserSaveDataForCheck Archive Path Data Format ===
 
{| class="wikitable" border="1"
 
|-
 
!  Index word
 
!  Description
 
|-
 
| 0
 
| Mediatype (must be non-zero)
 
|-
 
| 1
 
| Lower word saveid
 
|-
 
| 2
 
| Upper word saveid
 
|}
 
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.
 
 
 
=== ExtSaveData Archive Path Data Format ===
 
{| class="wikitable" border="1"
 
|-
 
!  Index word
 
!  Description
 
|-
 
| 0
 
| Mediatype
 
|-
 
| 1
 
| Lower word saveid
 
|-
 
| 2
 
| Upper word saveid
 
 
|}
 
|}
For FS, the file/directory lowpath is a text path in the [[extdata]] filesystem. For FSPXI, the file lowpath is a text path relative to the "/extdata/<ExtdataIDHigh>/<ExtdataIDLow>" directory on SD/NAND, for the cleartext extdata image to mount.
 

Latest revision as of 22:35, 5 September 2016

Request[edit]

Index Word Description
0 Header code [0x080201C2]
1 Transaction (usually 0)
2-3 u64, Archive Handle
4 Path Type
5 Path Size (including null-terminator)
6 Open Flags
7 Attributes (usually 0)
8 (PathSize << 14) | 2
9 Path Data Pointer

Response[edit]

Index Word Description
0 Header code
1 Result code
2 Move handle descriptor (0x10)
3 File client session handle