From: Jim M. <jam...@ho...> - 2008-09-18 00:30:20
|
As I was going through the code for the brew protocol I noticed there was a command for getting a list of sub-directories directly under a given directory, but didn't see a command for getting a list of files in a given directory. On a hunch I tried command code 3, since it wasn't being used for anything and that was it. Here are the details: [Get File List Request] 59 brew header 03 "GET FILE LIST" command code 0d lenth of parent directory path 6d 6f 74 6f 72 6f 6c 61 2f 65 6d 73 00 parent dir = "motorola/ems\0" [Get File List Response] 59 brew header 03 "GET FILE LIST" command code 00 error code 23 00 number of file entries that follow = 0x0023 fe 00 size of data block that follows = 0x00fe {Each file name is seperated by a null. Block is terminated with a null} 6d 6f 74 6f 72 6f 6c 61 2f motorola/ 65 6d 73 2f 41 6e 67 72 79 2e 72 61 6e 00 6d 6f ems/Angry.ran.mo 74 6f 72 6f 6c 61 2f 65 6d 73 2f 43 68 69 6d 65 torola/ems/Chime 73 20 48 69 67 68 2e 6d 69 64 00 6d 6f 74 6f 72 s High.mid.motor 6f 6c 61 2f 65 6d 73 2f 43 68 69 6d 65 73 20 4c ola/ems/Chimes L 6f 77 2e 6d 69 64 00 6d 6f 74 6f 72 6f 6c 61 2f ow.mid.motorola/ 65 6d 73 2f 43 68 6f 72 64 20 48 69 67 68 2e 6d ems/Chord High.m 69 64 00 6d 6f 74 6f 72 6f 6c 61 2f 65 6d 73 2f id.motorola/ems/ 43 68 6f 72 64 20 4c 6f 77 2e 6d 69 64 00 6d 6f Chord Low.mid.mo 74 6f 72 6f 6c 61 2f 65 6d 73 2f 43 6c 61 70 73 torola/ems/Claps 2e 6d 69 64 00 6d 6f 74 6f 72 6f 6c 61 2f 65 6d .mid.motorola/em 73 2f 43 6f 6e 66 75 73 65 64 2e 72 61 6e 00 6d s/Confused.ran.m 6f 74 6f 72 6f 6c 61 2f 65 6d 73 2f 43 72 79 69 otorola/ems/Cryi 6e 67 2e 72 61 6e 00 6d 6f 74 6f 72 6f 6c 61 2f ng.ran.motorola/ 65 6d 73 2f 44 65 76 69 6c 2e 72 61 6e 00 6d 6f ems/Devil.ran.mo 74 6f 72 6f 6c 61 2f 65 6d 73 2f 44 69 6e 67 2e torola/ems/Ding. 6d 69 64 00 00 mid.. |