elves / elvish

Powerful scripting language & versatile interactive shell
https://elv.sh/
BSD 2-Clause "Simplified" License
5.53k stars 297 forks source link

Implement `path:stat` #1688

Closed krader1961 closed 1 year ago

krader1961 commented 1 year ago

In theory the path:stat command introduced by this change allows an Elvish implementation of something like the Unix ls, or Windows dir, command. More importantly, it provides a more general API than builtins like path:is-dir and path:is-regular. Making it possible to test many other path attributes. I didn't deprecate those related commands because they are probably used often enough it doesn't make sense to deprecate them.

Related: #1659

krader1961 commented 1 year ago

I should also mention that my original motivation for this command was to make it easier to unit test related commands such as the path:chmod I have in my pipeline of path module changes to resolve #1659.

krader1961 commented 1 year ago

Closing until the os module is introduced after which I will reinstate this change.