likun7981 / hlink

批量、快速硬链工具(The batch, fast hard link toolkit)
https://hlink.likun.me
MIT License
641 stars 59 forks source link

No such file or directory问题,脚本匹配文件或文件夹的某些字符时会出错,需要手动排除,再手动硬链接这些文件 #189

Open up55 opened 1 month ago

up55 commented 1 month ago

目前发现文件或文件夹中有', .part, .parts, .partial的文件时会出错No such file or directory 解决方法,手动排除这些文件,参考配置如下

    exclude: {
      globs: ['**/*\'*/**', '**/*\'*'], 
      exts: [
        'partial',
        'parts',
        'part'
      ]
    }

错误信息:

Command failed with exit code 1: ln C:\d\lib\downloads\影视\电影\Ghibli.Anime.Collection.1979-2013.BluRay.1080p.x264.DTS.AC3-HDWinG\Howl's.Moving.Castle.2004.BluRay.1080p.x264.DTS.AC3.4Audio-HDWinG\Howl's.Moving.Castle.2004.BluRay.1080p.x264.DTS.AC3.4Audio-HDWinG.mkv C:\d\lib\library\影视\电影\Ghibli.Anime.Collection.1979-2013.BluRay.1080p.x264.DTS.AC3-HDWinG\Howl's.Moving.Castle.2004.BluRay.1080p.x264.DTS.AC3.4Audio-HDWinG
ln: failed to access 'C:\d\lib\downloads\影视\电影\Ghibli.Anime.Collection.1979-2013.BluRay.1080p.x264.DTS.AC3-HDWinG\Howls.Moving.Castle.2004.BluRay.1080p.x264.DTS.AC3.4Audio-HDWinG\Howls.Moving.Castle.2004.BluRay.1080p.x264.DTS.AC3.4Audio-HDWinG.mkv': No such file or directory
Error: Command failed with exit code 1: ln C:\d\lib\downloads\影视\电影\Ghibli.Anime.Collection.1979-2013.BluRay.1080p.x264.DTS.AC3-HDWinG\Howl's.Moving.Castle.2004.BluRay.1080p.x264.DTS.AC3.4Audio-HDWinG\Howl's.Moving.Castle.2004.BluRay.1080p.x264.DTS.AC3.4Audio-HDWinG.mkv C:\d\lib\library\影视\电影\Ghibli.Anime.Collection.1979-2013.BluRay.1080p.x264.DTS.AC3-HDWinG\Howl's.Moving.Castle.2004.BluRay.1080p.x264.DTS.AC3.4Audio-HDWinG
ln: failed to access 'C:\d\lib\downloads\影视\电影\Ghibli.Anime.Collection.1979-2013.BluRay.1080p.x264.DTS.AC3-HDWinG\Howls.Moving.Castle.2004.BluRay.1080p.x264.DTS.AC3.4Audio-HDWinG\Howls.Moving.Castle.2004.BluRay.1080p.x264.DTS.AC3.4Audio-HDWinG.mkv': No such file or directory
up55 commented 1 month ago

windows手动硬链接工具推荐:HardLinkShellExt 官网:https://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html

guoyuejiang commented 1 month ago

你用的是windows么?单引号,我改了link.js的一行代码好像解决了,应该是字符串里的单引号被吃掉了 await execa(ln "${sourceFile}" "${originalDestPath}");

up55 commented 1 month ago

你用的是windows么?单引号,我改了link.js的一行代码好像解决了,应该是字符串里的单引号被吃掉了 await execa(ln "${sourceFile}" "${originalDestPath}");

兄弟,你的 ` 也被吃掉了,你代码里的 ` 和markdown语法冲突了,我还寻思你语法咋错了呢,试了半天,又想估计是execa函数转义了字符,试了半天还是不行,点一下回复才发现你的原代码是await execa(`ln "${sourceFile}" "${originalDestPath}"`);,今天算是被转义给坑惨了。。。。 最后用你的代码没问题了,感谢!