android:adb拉窗口的文件路径限制?

时间:2012-04-02 09:00:47

标签: android

当我使用adb pull从手机中提取某些文件时,我收到了如下错误:无法创建“某个文件”:没有此类文件或目录

的细节是:我创建一个名为 “A.TXT” 的文件,文件夹下的/ mnt / SD卡/ DCIM / 100ANDRO / vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv中, “V v ......” 是我下的/ mnt / SD卡创建一个文件夹/ DCIM / 100ANDRO /,然后我打开命令终端和切换到C:/和运行命令:C:\ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa> ADB拉/ MNT / SD卡/ DCIM / 100ANDRO / vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolder

这里:a .......... a是我在C:\盘创建的文件夹,v .... v是我在/ mnt / sdcard / dcim / 100ANDRO /下创建的文件夹,“folder ... folder ... folder”是我想要创建的目标文件夹。

结果是:pull:建立文件列表......

pull: /mnt/sdcard/DCIM/100ANDRO/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv/a.txt -> folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolder/a.txt
cannot create 'folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf
olderfolderfolderfolderfolderfolder\a.txt': No such file or directory

但如果目标文件夹长度较短,命令将成功!

C:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaa>adb pull /mnt/sdcard/DCIM/100ANDRO/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv folderfolderfolderfolderfolderfo
lderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfold
pull: building file list...
pull: /mnt/sdcard/DCIM/100ANDRO/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv/a.txt -> folderfolderfolderfolderfolderfolderfolderfolderfolder
folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfold/a.txt
1 file pulled. 0 files skipped.
0 KB/s (12 bytes in 0.070s)

为什么会这样?这是adb.exe的缺陷吗?请帮助,非常感谢。

2 个答案:

答案 0 :(得分:0)

请参阅以下链接: http://msdn.microsoft.com/en-us/library/aa365247.aspx

  

在Windows API中(以下段落中讨论了一些例外),路径的最大长度为MAX_PATH,定义为260个字符。

您的路径是否超过260 /?

答案 1 :(得分:0)

我在使用 cmd.exe + 260 个字符组策略编辑器/注册表修复 + 重新启动时遇到了这个问题。一旦我切换到 powershell,我就可以从我的手机adb pull 我的文件。如果这不起作用,请尝试 git bash。