Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

远程文件删除错误 #103

Open
linyf2008 opened this issue Dec 15, 2016 · 6 comments
Open

远程文件删除错误 #103

linyf2008 opened this issue Dec 15, 2016 · 6 comments

Comments

@linyf2008
Copy link

错误信息如下:
root@uk1:~# pcs rm "${last}"
Error: 删除文件失败,请稍候重试 path=/***at_Five_2016-12-01_Thu.mp4.

(上述输出中,***不是程序自身输出,只是我不想说明具体文件名)
设备是VPS,Ubuntu14.04.5LTS

@linyf2008
Copy link
Author

旧版的错误信息如下:
root@uk1:~# pcs rm "${last}"
Segmentation fault

@jeffswt
Copy link

jeffswt commented Dec 19, 2016

This problem always seems to happen.

Same on Windows.

@Droid-MAX
Copy link

这是程序的问题

@Droid-MAX
Copy link

https://github.com/GangZhuo/BaiduPCS/blob/master/pcs/pcs.c (这个文件的876到918行,貌似是错误状态判断的相关代码)
if (res->error != 0) {

	int is_move = strcmp(opera, "move") == 0;

	if (is_move || strcmp(opera, "copy") == 0) {

		if (res->error == 12) {

			if (!err_no_space && !err_src_file_not_exist && !err_target_not_exist) {

				pcs_set_errmsg(handle, "%s%s", is_move ? "移动" : "复制", "失败,请稍候重试");

			}

			else {

				if (cnt == file_count && !err_has_succ_items) {

					if (err_no_space)

						pcs_set_errmsg(handle, "%s%s", is_move ? "移动" : "复制", "失败,剩余空间不足");

					else if (err_target_not_exist)

						pcs_set_errmsg(handle, "%s%s", is_move ? "移动" : "复制", "失败,文件已存在于目标文件夹中");

					else if (err_src_file_not_exist)

						pcs_set_errmsg(handle, "%s%s", is_move ? "移动" : "复制", "失败,待处理文件不存在");

				}

				else {

					if (err_no_space)

						pcs_set_errmsg(handle, "%s%s", is_move ? "移动" : "复制", "失败,剩余空间不足");

					else if (err_target_not_exist)

						pcs_set_errmsg(handle, "%s%s", is_move ? "移动" : "复制", "失败,部分文件已存在于目标文件夹中");

					else if (err_src_file_not_exist)

						pcs_set_errmsg(handle, "%s%s", is_move ? "移动" : "复制", "失败,部分待处理文件不存在");

				}

			}

		}

		else {

			pcs_set_errmsg(handle, "%s%s", is_move ? "移动" : "复制", "失败,未知错误");

		}

	}

	else if (strcmp(opera, "delete") == 0) {

		pcs_set_errmsg(handle, "删除文件失败,请稍候重试");

	}

	else if (strcmp(opera, "rename") == 0) {

		if (res->error == -8 || res->error == -9 || (cnt > 0 && (res->info_list->info.error == -8 || res->info_list->info.error == -9)))

			pcs_set_errmsg(handle, "名称已在使用,请使用其他名称");

		else if (res->error == 12 && cnt > 0 && res->info_list->info.error == -9)

			pcs_set_errmsg(handle, "重命名失败,文件已被删除或移走");

		else

			pcs_set_errmsg(handle, "文件(夹)重命名失败, 网络错误");

	}

}

return res;

@linyf2008
Copy link
Author

百度的API一直在更新?

@linyf2008
Copy link
Author

一个非常尴尬的情况:
0.25版本在Windows下能正常删除文件,但我在Ubuntu 14.04LTS 64bit上用源代码编译后的程序老是提示:
Segmentation fault
0.26版本在Linux上显示的是:
Error: 删除文件失败,请稍候重试 path=。。。(具体内容省略)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants