Improve case-sensitive path comparison
- Lingua principale
- C#
- Stelle
- 104
- Fork
- 15
- Merge medio
- 9m
- PR unite (30g)
- 2
Descrizione
I suggest the following changes.
1. Introduce three different path comparator kinds.
- [x] Textual only. This one should operate on strict string equality, and named accordingly (something like `StrictStringPathComparer`?).
- [x] Platform-default comparer: should implement case-sensitive comparison on Linux, and case-insensitive (probably with corresponding relaxations related to Unicode normalization) on Windows and macOS.
- [ ] File-system-aware comparer: for each compared path component, should compare the actual case sensitivity of the corresponding file system subroot. For non-existent paths, it should use the platform-dependent policy of calculating the case sensitivity for new subdirectories (is it normally taken from the parent directory?).
This one is obviously IO-intensive, so I'm thinking of introducing some sort of "sensitivity cache" that'd store the lists of checked paths and subtrees in a trie data structure, and would be used for one or multiple operations (probably one per comparer instance, with the ability of manual reset).
2. Allow the paths to use different comparers; platform-default being used by default, as one giving the best precision while not losing performance dur to intensive IO.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Non vengono indicati file o test. Inizia individuando l’implementazione esistente del confronto dei percorsi e la sua API pubblica, quindi segui il modo in cui vengono selezionati i valori predefiniti della piattaforma. L’issue è completata quando sono definite policy di confronto testuale, predefinita della piattaforma e consapevole del file system, e i chiamanti possono scegliere un comparer, preservando il comportamento predefinito della piattaforma.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- operating-systems
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100