SWAT-engineering / SWAT-engineering/java-watch
Use an internal index to more accurately track renames on macOS
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 1
- Forks
- 0
- Merge medio
- 14 h 40 min
- PR fusionados (30 d)
- 1
Descripción
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza rastreando el manejo de macOS FSEvents y cómo se interpretan actualmente ITEM_RENAMED, ITEM_CREATED y ITEM_REMOVED. Reproduce los tres casos de movimiento descritos en el issue y, después, define la finalización como la capacidad de distinguir los movimientos hacia dentro, hacia fuera y dentro del ámbito observado sin depender únicamente de una comprobación de la existencia en el sistema de archivos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, macos
- Área
- operating-systems
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 30/100