Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

DirectoryMonitor behavior on file rename can be surprising  #1858

@ranweiler

Description

@ranweiler

The following is arguably not a bug, but is a subtlety that should at least be documented.

Suppose we have:

  • An outer directory outer and a child directory outer/watched
  • A DirectoryMonitor that is watching the child dir, outer/watched
  • No other files or directories

The following shell transcript will result in the monitor reporting the creation of 1 file, myfile.txt:

cd outer

# Create `myfile.txt` in `outer`.
touch myfile.txt

# Move the file into the watched directory.
# 
# This is reported by the monitor.
mv myfile.txt ./watched/myfile.txt

Counterintuitively, from a clean slate, the following shell transcript will result in the monitor reporting the creation of 1 file, .tmp.txt.

cd outer/watched

# This is reported by the monitor.
touch .tmp.txt

# This is NOT reported as a created file.
mv .tmp.txt myfile.txt

This is true on both Linux and Windows.

AB#35926

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions