SWAT-engineering / SWAT-engineering/java-watch
Use an internal index to more accurately track renames on macOS
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 1
- Fork
- 0
- Merge medio
- 14h 40m
- PR unite (30g)
- 1
Descrizione
When a file is moved and we're using the native FSEvents API on macOS, it issues native events with flag ITEM_RENAMED set, but not flags ITEM_CREATED or ITEM_REMOVED. Typical cases include:
- Moving a file within the watch scope. In this case, there are two native events: one for the source (logically: delete), and one for the destination (logically: create).
- Moving a file into the watch scope. In this case, there is one native event, for the destination (logically: create).
- Moving a file out of the watch scope. In this case, there is one native event, for the source (logically: delete).
Because flags ITEM_CREATED and ITEM_REMOVED aren't set, the native events in cases 2 and 3 are indistinguishable. Currently, this is solved by asking the file system if the file exists: if it does, we assume it's case 2; if it doesn't, we assume it's case 3. However, this can be inaccurate (because things can have happened to the file between the native event was issued and asking the file system). A more accurate approach could be to maintain our own index.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando la gestione di macOS FSEvents e il modo in cui ITEM_RENAMED, ITEM_CREATED e ITEM_REMOVED vengono attualmente interpretati. Riproduci i tre casi di spostamento descritti nell’issue, quindi definisci il completamento come la distinzione tra gli spostamenti verso l’interno, verso l’esterno e all’interno dell’ambito monitorato, senza affidarti soltanto a un controllo dell’esistenza nel file system.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, macos
- Ambito
- operating-systems
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 30/100