Aaron Z
2006-02-05 06:45:42 UTC
I've been reading Aaron and Stephen's conversation on the A900; I
think the problem is that reading a 'pascal' string from the buffer is
assuming a one-byte length, and the a900's listdirectoryresponse
header: 59 0a 00
entrynumber: 00 00 00 00
unknown1: 01 00 00 00 47 47 c6 00 07 00 00 00 30 de 63 03 01
subdir: [should be] 00 05 2f 62 72 65 77
... but subdir.readfrombuffer() sees a length of 0, not of 5, and dies
right there. So we get into this loop where we try to parse a bunch of
subdirs named '' (empty string), which is just the root dir all over
again.
Other-Aaron, you can temporarily fix this in your copy of bitpim by
reading two length bytes instead of one -- at prototype.py, line 341,
dup the self._sizeinbytes line. This just throws away the first byte,
of course, but for the moment, it'll do. Once I did this, I read the
filesystem beautifully, save for a double exception when I try to read
the .$ directory. I ignored this and bitpim continued to run, so I
didn't debug it further.
I, too, would love to sync my calendar with bitpim. Now that we've
gotten this far, Stephen, what's next?
think the problem is that reading a 'pascal' string from the buffer is
assuming a one-byte length, and the a900's listdirectoryresponse
00000000 59 0a 00 00 00 00 00 01 00 00 00 47 47 c6 00 07 Y..........GG...
00000010 00 00 00 30 de 63 03 01 00 05 2f 62 72 65 77 ...0.c..../brew
By running bitpim under eclipse/pydev, this parses as follows:00000010 00 00 00 30 de 63 03 01 00 05 2f 62 72 65 77 ...0.c..../brew
header: 59 0a 00
entrynumber: 00 00 00 00
unknown1: 01 00 00 00 47 47 c6 00 07 00 00 00 30 de 63 03 01
subdir: [should be] 00 05 2f 62 72 65 77
... but subdir.readfrombuffer() sees a length of 0, not of 5, and dies
right there. So we get into this loop where we try to parse a bunch of
subdirs named '' (empty string), which is just the root dir all over
again.
Other-Aaron, you can temporarily fix this in your copy of bitpim by
reading two length bytes instead of one -- at prototype.py, line 341,
dup the self._sizeinbytes line. This just throws away the first byte,
of course, but for the moment, it'll do. Once I did this, I read the
filesystem beautifully, save for a double exception when I try to read
the .$ directory. I ignored this and bitpim continued to run, so I
didn't debug it further.
I, too, would love to sync my calendar with bitpim. Now that we've
gotten this far, Stephen, what's next?