91bd860d72824ec042d390ff282b8ca148649288
[fuse-aexplorer.git] / ae-protocol.md
1 Message types
2 ==============
3
4      Msg ID | Sending side | Description
5     --------|--------------|----------------------------------
6          00 | Ami/PC       | Ask for next block
7          01 | Ami/PC       | Transfer cancelled
8          02 | Ami/PC       | Initialisation / Init response
9          03 | Ami/?        | Multipart header
10          04 | Amiga        | EOF (no payload)
11          05 | Amiga        | Next data block
12
13          08 | Amiga        | File already exists (when trying to write with 0x66)
14          09 | Amiga        | Size ? (response to 0x6c)
15          0a | Amiga        | Close response
16          0b | Amiga        | Format response?
17
18          64 | PC           | List directory
19          65 | PC           | File read
20          66 | PC           | File/folder write
21          67 | PC           | File/folder delete (recursively)
22          68 | PC           | File rename (name changes) (works on drives, too?)
23          69 | PC           | File move (path changes)
24          6a | PC           | File copy
25          6b | PC           | Set attributes and comment
26          6c | PC           | Request size on disk (?)
27          6d | PC           | Close file
28          6e | PC           | Format disk (needs Kickstart 2.0 or newer)
29          6f | PC           | New folder
30
31
32
33
34 Request details
35 ================
36
37 64 - List a directory
38 ----------------------
39
40 ### TODO ###
41
42
43 65 - Read a file
44 -----------------
45
46 ### TODO ###
47
48
49 66 - Write a file
50 ------------------
51
52 ### TODO ###
53
54
55 67 - Delete file/folder
56 ------------------------
57
58 Payload:
59
60      Bytes | Content
61     -------|--------------------
62          n | Path
63          1 | 0x00
64
65 Then, read type 0 for confirmation.
66 Then, sendClose() (0xa response: 5x 00).
67
68 If Path is a folder, it will be deleted together with its contents.
69
70
71 68 - Rename file/folder
72 ------------------------
73
74 Payload:
75
76      Bytes | Content
77     -------|--------------------
78          n | Path (including old file name)
79          1 | 0x00
80          n | New file name (without path)
81          1 | 0x00
82
83 Then, read type 0 for confirmation.
84 Then, sendClose() (0xa response: 5x 00).
85
86
87 69 - Move file/folder
88 ----------------------
89
90 Payload:
91
92      Bytes | Content
93     -------|--------------------
94          n | Path (including old file name)
95          1 | 0x00
96          n | New path to contain file (folder without trailing slash or file name)
97          1 | 0x00
98          1 | 0xc9 (?)
99
100 Then, read type 0 for confirmation.
101 Then, sendClose() (0xa response: 5x 00).
102
103 If Path is a folder, it will be moved together with its contents.
104 This command appears to work across devices.
105
106
107 6a - Copy file/folder
108 ----------------------
109
110 Payload:
111
112      Bytes | Content
113     -------|--------------------
114          n | Path (including old file name)
115          1 | 0x00
116          n | New path to contain file (folder without trailing slash or file name)
117          1 | 0x00
118          1 | 0xc9 (?)
119
120 Then, read type 0 for confirmation.
121 Then, sendClose() (0xa response: 5x 00).
122
123 If Path is a folder, it will be moved together with its contents.
124 This command appears to work across devices.
125
126
127 6b - Set attributes and comment
128 --------------------------------
129
130 Payload:
131
132      Bytes | Content
133     -------|--------------------
134          4 | Attributes
135          n | Path
136          1 | 0x00
137          n | Comment
138          1 | 0x00
139          4 | Checksum? (seems to be 0x00000000 if comment empty)
140
141 Then, read type 0 for confirmation.
142 Then, sendClose() (0xa response: 5x 00).
143
144
145 6c - Request size on disk (?)
146 ------------------------------------
147
148 Payload:
149
150      Bytes | Content
151     -------|--------------------
152          n | Path
153          1 | 0x00
154
155 Then, read type 0 for confirmation.
156 Then, read type 9 for 12 bytes of payload (### TODO ###).
157 Then, send type 0 to request more data (no payload).
158 Then, read type 9 for 12 bytes of payload (### TODO ###).
159 Then, send type 0 to request more data (no payload).
160 Then, read type 0 signaling end of attributes (no payload).
161 Then, sendClose() (0xa response: 5x 00).
162
163 OR
164
165 Then, read type 0 for confirmation.
166 Then, read type 0 signaling end of attributes (no payload).
167 Then, sendClose() (0xa response: 5x 00).
168
169
170
171 6d - Close file
172 ----------------
173
174 No payload.
175
176 Then, read type 0x0a for confirmation (typical payload: 5 bytes of 0x00).
177
178 This is used to finish an operation, such as a directory listing
179 or renaming a file.
180
181
182 6e - Format disk
183 -----------------
184
185 ### TODO ###
186
187
188 6f - New folder
189 ----------------
190
191 Payload:
192
193      Bytes |  Content
194     -------|--------------------
195          n | Parent path
196          1 | 0x00
197
198 Then, read type 0 for confirmation.
199 Then, sendClose() (0xa response: 5x 00).
200
201 The host will create a new folder in the given path, together with a
202 matching .info file.
203 The folder name cannot be chosen, and will be something like "Unnamed1".
204
205 To create a folder with a specific name, use 0x66.
206 Note that 0x66'ing a folder does not seem to set its time.