Project Log SP5 Teaching Break Week 2

26/08/11 - 02/10/11

Continuing with the ID3 user interface.

The acquisition process is proving quite difficult to implement.

Decided to implement the dd process using python and get the script to print out the stats.

A python package called pexpect allows you to call a Unix program using ssh, pass the password to ssh and return the output.

I have implemented the dd process and the the stats are returned on one line as follows every 5 seconds.

diskSize bytesCopied elapsedTime rate bytes/per/second

Output from python ddiDevice.py -f /tmp/tim.img

243862672 131690496 0.00 0.00

243862672 260046848 5.292755 24881276

243862672 391144448 10.469641 24838182

243862672 520093696 15.477443 25271904

243862672 638780416 20.661754 25171808

243862672 761486848 25.669000 24885286

243862672 889192448 30.676301 24823294

243862672 1023410176 35.873407 24786953

243862672 1048576000 41.052647 24929213

243862672 1048576000 41.728396 25128596

done

I found when I run the python script inside x-code it does not run correctly and print out the text.

This was due to python buffering the stdout file descriptor. To prevent this happening python needs to be called with the -u option.

" -u Force stdin, stdout and stderr to be totally unbuffered. On systems where it matters, also put stdin, stdout and stderr in binary mode."

The dump progress bar is now working.

References

Python command line options.

Python pexpect package.

iOS 4 SDK for JavaScript Programmers

( Goodman 2011)

Comments !

blogroll