GithubHelp home page GithubHelp logo

hlink 未能正确判断源目录中的文件改动,对源目录新增的文件提示“硬链已存在, 跳过创建” about hlink HOT 4 CLOSED

likun7981 avatar likun7981 commented on June 1, 2024
hlink 未能正确判断源目录中的文件改动,对源目录新增的文件提示“硬链已存在, 跳过创建”

from hlink.

Comments (4)

likun7981 avatar likun7981 commented on June 1, 2024

目标地址不要包含源地址,你这个配置 目标地址包含了源地址~,所以检测的时候 可能是检测到了源地址里面的文件

from hlink.

likun7981 avatar likun7981 commented on June 1, 2024

如何做到“重复硬链检测”

看下这段代码

from hlink.

xdujiang avatar xdujiang commented on June 1, 2024

非常感谢,我重新试了一下,的确是因为目标地址包含源地址导致的这个问题。(果然是程序员永远也不知道用户会怎么使用程序)

学习了一下“重复硬链检测”的代码段,我的理解是先读取 source 中文件的 inode 号,然后查找 target 中是否存在同为该 inode 号的文件,若存在则说明已有硬链接。这样的话似乎可以通过在 find 命令中加入参数排除 source 目录来解决该问题?

在 source 和 target 都使用绝对路径的情况下,使用 “-prune” 参数可以排除 source 目录下的相应文件。
find <target> -path <source> -prune -false -o -inum <inode_num>

from hlink.

xdujiang avatar xdujiang commented on June 1, 2024

还有个问题,现在程序似乎无法手动停止执行?

在终端中按 ctrl-c,程序还是继续跑,需要断掉终端才能停下程序,请问这个是设计如此还是?

from hlink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.