mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Path
- Implemented Path::is_link, although it doesn't work. Why?
This commit is contained in:
parent
0ffc95e312
commit
92010eeb2c
2 changed files with 12 additions and 0 deletions
11
src/Path.cpp
11
src/Path.cpp
|
@ -176,6 +176,17 @@ bool Path::is_absolute () const
|
|||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Path::is_link () const
|
||||
{
|
||||
struct stat s = {0};
|
||||
if (! stat (_data.c_str (), &s) &&
|
||||
s.st_mode & S_IFLNK)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Path::readable () const
|
||||
{
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
bool exists () const;
|
||||
bool is_directory () const;
|
||||
bool is_absolute () const;
|
||||
bool is_link () const;
|
||||
bool readable () const;
|
||||
bool writable () const;
|
||||
bool executable () const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue