Git Product home page Git Product logo

jp-watch-c's People

Contributors

jdspugh avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

jp-watch-c's Issues

Differences in output between MacOS & Linux

The results of running jp-watch on Linux and MacOS are currently different. The differences are summarised below with the type of change and the resulting output per OS. Ideally the Linux version should produce output that is the same as the MacOS version which is more correct. Linux usually returns parent directories of changes instead of the actual changed files or directories:

FILE EDIT: echo '123' > <existing file>

Linux

  • <existing file>

MacOS

  • <existing file>

FILE CREATION: touch <file>

Linux

  • Parent Directory: <parent dir>
  • File: <file> (should be just <file>)
  • Note: b contains FAN_CREATE (ignore the lone create event)
  • b2 contains FAN_MODIFY (return this only)

MacOS

  • <file>

DIRECTORY CREATION: mkdir <dir>

Linux

  • Parent Directory: <parent dir> (should be <dir>)
  • Note: b contains FAN_CREATE + FAN_ONDIR

MacOS

  • <dir>

FILE/DIRECTORY MOVE: mv <file> <dir> | mv <dir> <dir>

Linux

  • Parent Directory: <parent dir> (should be <file>)
  • Fix/Hack:
    • Three events will appear in b:
      • b contains FAN_MOVE (src parent path)
      • b contains FAN_MOVE (dst parent path)
      • b contains FAN_MOVE_SELF (the end of this path contains the name of the file moved)
    • Take the file name from FAN_MOVE_SELF and append it to both FAN_MOVE directory paths. Output only the FAN_MOVE directory paths with the appended filename.

MacOS

  • Destination: dst <dir/file>
  • Source: src <dir/file>

Linux: Creating a new file outputs two duplicate paths

touch a

or

echo '' > a

will results in duplicate paths output by jp-watch

/path/a
/path/a

This is because both a FAN_CREATE and a FAN_ATTRIB event is emitted for the same path. A solution could be storing the last path in the app's main event processing loop and use it to eliminate duplicate paths through loop iterations.

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.