Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Reader does not work when read hardlink #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Commits on Oct 10, 2016

  1. Reader does not work when read hardlink

    I think the following code must be deleted.
    Because the hardlink will be read by LinkReader. But the hardlink is just file.Trust me!
    ```
       var handleHardlinks = props.hardlinks !== false
    
        // special little thing for handling hardlinks.
        if (handleHardlinks && type !== 'Directory' && props.nlink && props.nlink > 1) {
          var k = props.dev + ':' + props.ino
          // console.error("Reader has nlink", self._path, k)
          if (hardLinks[k] === self._path || !hardLinks[k]) {
            hardLinks[k] = self._path
          } else {
            // switch into hardlink mode.
            type = self.type = self.props.type = 'Link'
            self.Link = self.props.Link = true
            self.linkpath = self.props.linkpath = hardLinks[k]
            // console.error("Hardlink detected, switching mode", self._path, self.linkpath)
            // Setting __proto__ would arguably be the "correct"
            // approach here, but that just seems too wrong.
            self._stat = self._read = LinkReader.prototype._read
          }
        }
    ```
    pauky authored Oct 10, 2016
    Configuration menu
    Copy the full SHA
    5af0ec3 View commit details
    Browse the repository at this point in the history
  2. Update reader.js

    pauky authored Oct 10, 2016
    Configuration menu
    Copy the full SHA
    59ebf51 View commit details
    Browse the repository at this point in the history