当目标名称太长时 mv “不是目录”

当目标名称太长时 mv “不是目录”

我正在尝试在本地 Ubuntu 14.04 LTS vagrant box 上进行 svn checkout(通过 MTPutty 进行 SSH):

vagrant@vagrant-ubuntu-trusty-64:~/shared/dev$ svn checkout https://...
[...]
svn: E000020: Can't move '/home/vagrant/shared/dev/svv/.svn/tmp/svn-EGIIH6' to '/home/vagrant/shared/dev/svv/trunk_new/htdocs/vendor/white-october/pagerfanta-bundle/WhiteOctober/PagerfantaBundle/TestsProject/src/WhiteOctober/PagerfantaTestBundle/Resources/views/Pagerfanta/twitterBootstrap3TranslatedView.html.twig': Not a directory

但该目录存在:

vagrant@vagrant-ubuntu-trusty-64:~/shared/dev$ ls -al /home/vagrant/shared/dev/svv/trunk_new/htdocs/vendor/white-october/pagerfanta-bundle/WhiteOctober/PagerfantaBundle/TestsProject/src/WhiteOctober/PagerfantaTestBundle/Resources/views/Pagerfanta/
total 6
drwxrwxrwx 1 vagrant vagrant 4096 May 15 09:35 .
drwxrwxrwx 1 vagrant vagrant    0 May 15 09:27 ..
-rw-rw-rw- 1 vagrant vagrant   50 May 15 09:27 defaultTranslatedView.html.twig
-rw-rw-rw- 1 vagrant vagrant   41 May 15 09:27 myView1.html.twig
-rw-rw-rw- 1 vagrant vagrant   50 May 15 09:27 twitterBootstrap3View.html.twig
-rw-rw-rw- 1 vagrant vagrant   49 May 15 09:27 twitterBootstrapView.html.twig

然后我尝试手动 mv 文件,但也失败了:

vagrant@vagrant-ubuntu-trusty-64:~/shared/dev$ sudo mv /home/vagrant/shared/dev/svv/.svn/tmp/svn-EGIIH6 /home/vagrant/shared/dev/svv/trunk_new/htdocs/vendor/white-october/pagerfanta-bundle/WhiteOctober/PagerfantaBundle/TestsProject/src/WhiteOctober/PagerfantaTestBundle/Resources/views/Pagerfanta/twitterBootstrap3TranslatedView.html.twig
mv: cannot move ‘/home/vagrant/shared/dev/svv/.svn/tmp/svn-EGIIH6’ to ‘/home/vagrant/shared/dev/svv/trunk_new/htdocs/vendor/white-october/pagerfanta-bundle/WhiteOctober/PagerfantaBundle/TestsProject/src/WhiteOctober/PagerfantaTestBundle/Resources/views/Pagerfanta/twitterBootstrap3TranslatedView.html.twig’: Not a directory

如果我缩短文件名,mv 就会成功:

vagrant@vagrant-ubuntu-trusty-64:~/shared/dev$ sudo mv /home/vagrant/shared/dev/svv/.svn/tmp/svn-EGIIH6 /home/vagrant/shared/dev/svv/trunk_new/htdocs/vendor/white-october/pagerfanta-bundle/WhiteOctober/PagerfantaBundle/TestsProject/src/WhiteOctober/PagerfantaTestBundle/Resources/views/Pagerfanta/twitter.html.twig
vagrant@vagrant-ubuntu-trusty-64:~/shared/dev$ ls -al  /home/vagrant/shared/dev/svv/trunk_new/htdocs/vendor/white-october/pagerfanta-bundle/WhiteOctober/PagerfantaBundle/TestsProject/src/WhiteOctober/PagerfantaTestBundle/Resources/views/Pagerfanta/
total 7
drwxrwxrwx 1 vagrant vagrant 4096 May 15 09:33 .
drwxrwxrwx 1 vagrant vagrant    0 May 15 09:27 ..
-rw-rw-rw- 1 vagrant vagrant   50 May 15 09:27 defaultTranslatedView.html.twig
-rw-rw-rw- 1 vagrant vagrant   41 May 15 09:27 myView1.html.twig
-rw-rw-rw- 1 vagrant vagrant   50 May 15 09:27 twitterBootstrap3View.html.twig
-rw-rw-rw- 1 vagrant vagrant   49 May 15 09:27 twitterBootstrapView.html.twig
-rw-rw-rw- 1 vagrant vagrant   61 May 15 09:27 twitter.html.twig

我在这里缺少什么?

编辑:

@Stéphane Chazelas 哇,我完全没想到这一点。我正在尝试在共享目录中进行 svn checkout 。文件名对于 NTFS 来说太长,并且由于它在主机和来宾之间同步,因此 mv 失败。队友的欢呼声。

第二次编辑:

@Stéphane Chazelas 共享目录曾经驻留在本地驱动器 ( C:\Users\benjamin.franke\Documents\Vagrant\data) 上的用户文件夹内。将文件夹移动到C:\dev使我能够在一个存储库上成功执行 svn 签出,但在另一个存储库中失败,该存储库包含具有更长路径的文件。

我的 Vagrantfile 同步文件夹条目如下所示:

 config.vm.synced_folder "C:/dev", "/home/vagrant/shared", :mount_options => ["dmode=775","fmode=664"]

我可能会尝试一下https://github.com/mitchellh/vagrant/pull/5495并将发布反馈。

相关内容