X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstat.h;h=55a1fec51b575f50b0208878a4e066a20383c98f;hp=4970ff8634b9d1a1cf99061c1dc73f27e4054bc6;hb=fa77438b62207466c48620604c8cc34931080936;hpb=a17d6ad286e19e2222ab8b6c9a762a83bf2c6c56 diff --git a/source/stat.h b/source/stat.h index 4970ff8..55a1fec 100644 --- a/source/stat.h +++ b/source/stat.h @@ -9,12 +9,11 @@ Distributed under the LGPL #define MSP_FS_STAT_H_ #include +#include "path.h" namespace Msp { namespace FS { -class Path; - /** Gets information about a file. Returns 0 on success or -1 on error. This version can be used to check for file existence and get information in one @@ -28,6 +27,12 @@ occurs. */ struct stat stat(const Path &fn); +/// Gets information about a file, without following symbolic links +int lstat(const Path &fn, struct stat &st); + +/// Returns information about a file, without following symbolic links +struct stat lstat(const Path &fn); + /// Tests for existence of a file bool exists(const Path &path); @@ -37,6 +42,9 @@ bool is_reg(const Path &path); /// Tests whether a path refers to an existing directory bool is_dir(const Path &path); +/// Tests whether a path refers to a symbolic link +bool is_link(const Path &path); + } // namespace FS } // namespace Msp