BaiduPCS icon indicating copy to clipboard operation
BaiduPCS copied to clipboard

在32位Linux平台上无法下载大文件

Open qnnnnez opened this issue 7 years ago • 4 comments

运行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只是创建了一个指定大小的文件,并没有真正为数据分配空间。

qnnnnez avatar Jun 20 '17 04:06 qnnnnez

我的也是这个情况,怎么解决啊。

qingliangshanren avatar Jul 12 '17 02:07 qingliangshanren

同硬盘充足,2G文件 Can't create the temp file

yue4u avatar Jul 13 '17 16:07 yue4u

试试修改 Makefile,加入 -D_FILE_OFFSET_BITS=64 后编译

GangZhuo avatar Aug 24 '17 06:08 GangZhuo

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 .

qingliangshanren avatar Sep 24 '17 09:09 qingliangshanren