BaiduPCS
BaiduPCS copied to clipboard
在32位Linux平台上无法下载大文件
运行baidupcs download SAMA-662.rar SAMA-662.rar
后提示Error: Can't create the temp file: SAMA-662.rar.6edf0b983e959eae4e7df0251a77035f.pcs_temp, maybe have no disk space.
但是实际上硬盘空间充足。
用strace
再次运行,发现truncate
返回了-1。
猜测原因是truncate
无法处理大文件,于是用一个小文件尝试,发现下载正常。
将源码中的truncate
手动改成truncate64
,再次strace
,发现truncate64
工作正常,临时文件成功创建且大小正常,但是依然报错,open("SAMA-662.rar.6edf0b983e959eae4e7df0251a77035f.pcs_temp", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EFBIG (File too large)
。
怀疑是编译参数有问题。
另外,建议在Linux平台上使用fallocate而不是truncate来分配空间。因为truncate只是创建了一个指定大小的文件,并没有真正为数据分配空间。
我的也是这个情况,怎么解决啊。
同硬盘充足,2G文件 Can't create the temp file
试试修改 Makefile,加入 -D_FILE_OFFSET_BITS=64 后编译
thank 谢谢,
2017-08-24 14:30 GMT+08:00 Gang Zhuo [email protected]:
试试修改 Makefile,加入 -D_FILE_OFFSET_BITS=64 后编译
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/GangZhuo/BaiduPCS/issues/201#issuecomment-324546002, or mute the thread https://github.com/notifications/unsubscribe-auth/ADmh8Zrb653HciTmJ22lrFCaOmweCdl5ks5sbRiVgaJpZM4N_Ffq .