sgtcortez / Termsequel

Bringing a portable SQL like syntax to our filesystem.
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

[FEAT]: Add option to follow symbolic links #98

Open sgtcortez opened 3 years ago

sgtcortez commented 3 years ago

What is your suggestion?

Nowadays, if termsequel find a symbolic link, it prints the information about it, and, do not follow the original file ...

Would be nice to let the user decide if he wants to follow symbolic links or not.
Example: Following symbolic links

$ termsequel --follow 'SELECT NAME FROM $HOME'

If, there is a symbolic link inside the $HOME directory, then, we will retrieve information about the file and not the symbolic link ...

Currently, we are using the flag AT_SYMLINK_NOFOLLOW, here which, can be the default.

Explanation about AT_SYMLINK_NOFOLLOW

If pathname is a symbolic link, do not dereference it: instead return information about the link itself, like lstat(2).