Delete file

requesttype=0x0d

Command: variable length (here 0x7e)

0000  3c 00 00 00 01 02 00 00 00 00 00 00 00 00 00 00  <...............
0010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0040  02 00 00 00 0d 00 00 11 3c 00 00 00 f8 f6 12 00  ........<.......
0050  43 3a 5c 44 43 49 4d 5c 31 33 33 43 41 4e 4f 4e  C:\DCIM\133CANON
0060  00 43 52 57 5f 33 33 34 31 2e 43 52 57 00 43 52  .CRW_3341.CRW.CR
0070  57 5f 33 33 34 31 2e 54 48 4d 00 00              W_3341.THM..
      

Here we delete both a raw image and its corresponding thumbnail file.

Response: 0x54 bytes

0000  00 00 00 00 01 03 00 00 00 00 00 00 00 00 00 00  ................
0010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000  02 00 00 00 0d 00 00 21 14 00 00 00 f8 f6 12 00  .......!........
0010  00 00 00 00                                      ....
      

Status codes:

0x00000000 No errors
0x02000022 File not found
0x02000029 File was protected
0x02000086 Path not found (success on at least G2 and EOS D30/D60)

Example command (delete JPEG image):

0000  2f 00 00 00 01 02 00 00 00 00 00 00 00 00 00 00  /...............
0010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0040  02 00 00 00 0d 00 00 11 2f 00 00 00 a8 f6 12 00  ......../.......
0050  43 3a 5c 44 43 49 4d 5c 31 33 33 43 41 4e 4f 4e  C:\DCIM\133CANON
0060  00 49 4d 47 5f 33 33 34 33 2e 4a 50 47 00 00     .IMG_3343.JPG..
      

We can specify a series of file names separated by NULs, with a double NUL at the end.

Data received via bulk_in after a command block: (Delete file) (file did not exist).

00000000 00 00 00 00 01 03 00 00-00 00 00 00 00 00 00 00 ................
00000010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000040 02 00 00 00 0D 00 00 21-14 00 00 00 78 56 34 12 .......!....xV4.
00000050 22 00 00 02                                     "...
      

Data received via bulk_in after a command block: (Delete file) (file was protected)

00000000 00 00 00 00 01 03 00 00-00 00 00 00 00 00 00 00 ................
00000010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000040 02 00 00 00 0D 00 00 21-14 00 00 00 78 56 34 12 .......!....xV4.
00000050 29 00 00 02                                     )...
      

Data received via bulk_in after a command block: (Delete file) (successful)

00000000 00 00 00 00 01 03 00 00-00 00 00 00 00 00 00 00 ................
00000010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000040 02 00 00 00 0D 00 00 21-14 00 00 00 78 56 34 12 .......!....xV4.
00000050 00 00 00 00                                     ....
      

Data received via bulk_in from a PowerShot G2 after a command block: (Delete file) (successful)

00000000  14 00 00 00 01 03 00 00-00 00 00 00 00 00 00 00  ................
00000010  20 00 00 00 00 00 00 00-00 00 00 00 00 00 01 00   ...............
00000020  00 00 c2 00 00 00 00 02-00 00 40 00 00 00 00 00  ..........@.....
00000030  02 00 00 00 00 00 00 00-00 02 20 00 00 00 20 00  .......... ... .
00000040  02 00 00 00 0d 00 00 21-14 00 00 00 07 00 00 00  .......!........
00000050  86 00 00 02            -                         ....