Adds a wrapper in Support/Filesystem.h for determining if a file descriptor refers to a terminal.
This patch is needed by an upcoming patch which needs to know if stdin has redirected input or not.
Differential D63858
[Support] Add sys::fs::is_tty() wrapper around isatty(3) abrachet on Jun 26 2019, 7:36 PM. Authored by
Details
Adds a wrapper in Support/Filesystem.h for determining if a file descriptor refers to a terminal. This patch is needed by an upcoming patch which needs to know if stdin has redirected input or not.
Diff Detail
Event TimelineComment Actions Code change looks good, but one very weird thing I noticed is that your change in the header is in "FileSystem.h" but the definitions are in "Path.inc". This seems wrong, and should probably be fixed, possibly by adding FileSystem.inc? Also, you should definitely get some more reviewers to look at this, as I don't want to be making the decision on that alone. Take a look at the commits history for the files you touched.
|
What about a) if the file descriptor is invalid (doesn't refer to anything) or b) doesn't refer to a terminal (in other words, be explicit with the false as well as the true)?