public void CHDK_DownloadFile(string filename, out byte[] data)
{
if (filename.Substring(0,2) != "A/")
{
throw new PTPException("cannot download file: invalid path (should start with \"A/\")");
}
SendCHDKCommand(CHDK_PTP_Command.PTP_CHDK_TempData, (new ASCIIEncoding()).GetBytes(filename), 1, 0);
Ensure_PTP_RC_OK();
SendCHDKCommand(CHDK_PTP_Command.PTP_CHDK_DownloadFile, out data, 0);
Ensure_PTP_RC_OK();
}