【发布时间】:2011-02-14 07:07:08
【问题描述】:
我正在尝试将 SQLite 数据库(Safari 缓存:Cache.db)中的 blob 数据保存到文件中,但由于某种原因,sqlite 不会读取整个 blob。我最终想在 ruby 中执行此操作,但现在直接在 sqlite 命令提示符下工作的东西很好。另外,我已经阅读了关于 stackoverflow 的所有条目,但其中大多数只讨论了将图像保存在 blob 中的性能,并且确实显示将 blob 保存到文件的条目是在 C# 中,这没有帮助我。这是我尝试过的:
sqlite> select * from cfurl_cache_response limit 1; 3501|0|945281827|0|http://www.gospelz.com/components/com_jomcomment/smilies/guest.gif|2010-02-24 16:20:07
sqlite> 从 cfurl_cache_blob_data 中选择 receiver_data,其中 entry_ID = 3501;
GIF89a(
原始 (guest.gif) 文件的 hexdump 显示 sqlite 在第一个空值后停止读取 blob:
$ hexdump -C guest.gif
00000000 47 49 46 38 39 61 28 00 28 00 f7 00 00 f1 f5 fd |GIF89a(.(.......|sqlite> .output test.gif
sqlite> 从 cfurl_cache_blob_data 中选择 receiver_data,其中 entry_ID = 3501;
$ hexdump -C test.gif
00000000 47 49 46 38 39 61 28 0a |GIF89a(.|
【问题讨论】: