mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Add method for checking if a path is a symbolic link.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118367 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -433,6 +433,15 @@ Path::isDirectory() const {
|
||||
return ((buf.st_mode & S_IFMT) == S_IFDIR) ? true : false;
|
||||
}
|
||||
|
||||
bool
|
||||
Path::isSymLink() const {
|
||||
struct stat buf;
|
||||
if (0 != lstat(path.c_str(), &buf))
|
||||
return false;
|
||||
return S_ISLNK(buf.st_mode);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
Path::canRead() const {
|
||||
return 0 == access(path.c_str(), R_OK);
|
||||
|
@@ -350,6 +350,11 @@ Path::isDirectory() const {
|
||||
(attr & FILE_ATTRIBUTE_DIRECTORY);
|
||||
}
|
||||
|
||||
bool
|
||||
Path::isSymLink() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
Path::canRead() const {
|
||||
// FIXME: take security attributes into account.
|
||||
|
Reference in New Issue
Block a user