From e283b08481cfec9aa55b3ddbf369d632c7aa7b0f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 18 Mar 2021 15:53:49 +0200 Subject: Add fdstat() --- libbutl/fdstream.mxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libbutl/fdstream.mxx') diff --git a/libbutl/fdstream.mxx b/libbutl/fdstream.mxx index c863d2c..9818732 100644 --- a/libbutl/fdstream.mxx +++ b/libbutl/fdstream.mxx @@ -30,7 +30,7 @@ import std.core; import std.io; #endif import butl.path; -import butl.filesystem; // permissions +import butl.filesystem; // permissions, entry_stat import butl.small_vector; #else #include @@ -862,9 +862,17 @@ LIBBUTL_MODEXPORT namespace butl LIBBUTL_SYMEXPORT void fdtruncate (int, std::uint64_t); - // Test whether a file descriptor refers to a terminal. Throw ios::failure on + // Return filesystem entry stat from file descriptor. Throw ios::failure on // the underlying OS error. // + // See also path_entry() in filesystem. + // + LIBBUTL_SYMEXPORT entry_stat + fdstat (int); + + // Test whether a file descriptor refers to a terminal. Throw ios::failure + // on the underlying OS error. + // LIBBUTL_SYMEXPORT bool fdterm (int); -- cgit v1.1