Skip to content

when a file is replaced by a directory #67

Closed

Description

@pclouds

The below commands create a file "df" first, then delete it and replace "df" with a directory. I would expect watchman to return "df" listing (i.e. df/file). Returning "df" only is probably not so helpful. I think this is a tricky case, if we can't do any better, I think the behavior should be documented somewhere (the same for replacing a directory with a file).

$ watchman watch /tmp/z
{
    "version": "2.9.3",
    "watch": "/tmp/z"
}
$ watchman find /tmp/z
{
    "version": "2.9.3",
    "clock": "c:1415969169:24704:6:3",
    "files": []
}
$ echo abc >df
$ watchman since /tmp/z/ "c:1415969169:24704:6:3"
{
    "version": "2.9.3",
    "clock": "c:1415969169:24704:6:8",
    "is_fresh_instance": false,
    "files": [
        {
            "dev": 24,
            "gid": 100,
            "name": "df",
            "exists": true,
            "size": 4,
            "mode": 33188,
            "uid": 1000,
            "mtime": 1416822103,
            "ctime": 1416822103,
            "ino": 89526671,
            "nlink": 1,
            "oclock": "c:1415969169:24704:6:5",
            "new": true,
            "cclock": "c:1415969169:24704:6:5"
        }
    ]
}
$ rm df ; mkdir df; echo df >df/file
$ watchman since /tmp/z/ "c:1415969169:24704:6:3"
{
    "version": "2.9.3",
    "clock": "c:1415969169:24704:6:12",
    "is_fresh_instance": false,
    "files": [
        {
            "dev": 24,
            "gid": 100,
            "name": "df",
            "exists": true,
            "size": 60,
            "mode": 16877,
            "uid": 1000,
            "mtime": 1416822140,
            "ctime": 1416822140,
            "ino": 89527844,
            "nlink": 2,
            "oclock": "c:1415969169:24704:6:10",
            "new": true,
            "cclock": "c:1415969169:24704:6:10"
        }
    ]
}

Activity

  1. pclouds commented on Nov 24, 2014

    @pclouds
    Author

    3.0.0 seems to fix this. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions