notify icon indicating copy to clipboard operation
notify copied to clipboard

Document whether Event.paths are absolute/relative/either

Open ndmitchell opened this issue 3 years ago • 2 comments

Currently it doesn't document whether the path is absolute or relative. In my testing on Linux with INotify it's absolute. Is that an invariant I can rely on? I think it would be useful to document either way.

ndmitchell avatar Nov 13 '22 22:11 ndmitchell

Pretty sure it's relative unless the path starts with a slash (i.e. /) which is the norm for Linux command lines.

Would like for this to be confirmed a contributor though.

Cypher1 avatar Nov 17 '22 10:11 Cypher1

I think we'll need tests for that. On linux the OS itself doesn't give you a full path. We're joining them together. And from that I'd expect that if you pass a relative path to watch, you'll get a relative path in the event - especially when watching a single file (as no WalkDir is involved which also may alter the absolute/relative behaviour). Maybe you can test that @ndmitchell We'll have to investigate this for all other backends as well.

If required, use canonicalize to get an absolute path.

0xpr03 avatar Nov 17 '22 13:11 0xpr03