bool File::exists() const
{
struct stat st;
- return (::stat(path.c_str(), &st) == 0);
+ return (::lstat(path.c_str(), &st) == 0);
}
bool File::canRead() const
bool File::isFile() const
{
struct stat st;
- if (::stat(path.c_str(), &st) != 0) {
+ if (::lstat(path.c_str(), &st) != 0) {
throw runtime::Exception(runtime::GetSystemErrorMessage());
}
bool File::isDirectory() const
{
struct stat st;
- if (::stat(path.c_str(), &st) != 0) {
+ if (::lstat(path.c_str(), &st) != 0) {
throw runtime::Exception(runtime::GetSystemErrorMessage());
}
bool File::isDevice() const
{
struct stat st;
- if (::stat(path.c_str(), &st) != 0) {
+ if (::lstat(path.c_str(), &st) != 0) {
throw runtime::Exception(runtime::GetSystemErrorMessage());
}
mode_t File::getMode() const
{
struct stat st;
- if (::stat(path.c_str(), &st) != 0) {
+ if (::lstat(path.c_str(), &st) != 0) {
throw runtime::Exception(runtime::GetSystemErrorMessage());
}
uid_t File::getUid() const
{
struct stat st;
- if (::stat(path.c_str(), &st) != 0) {
+ if (::lstat(path.c_str(), &st) != 0) {
throw runtime::Exception(runtime::GetSystemErrorMessage());
}
gid_t File::getGid() const
{
struct stat st;
- if (::stat(path.c_str(), &st) != 0) {
+ if (::lstat(path.c_str(), &st) != 0) {
throw runtime::Exception(runtime::GetSystemErrorMessage());
}
ino_t File::getInode() const
{
struct stat st;
- if (::stat(path.c_str(), &st) != 0) {
+ if (::lstat(path.c_str(), &st) != 0) {
throw runtime::Exception(runtime::GetSystemErrorMessage());
}
dev_t File::getDevice() const
{
struct stat st;
- if (::stat(path.c_str(), &st) != 0) {
+ if (::lstat(path.c_str(), &st) != 0) {
throw runtime::Exception(runtime::GetSystemErrorMessage());
}
off_t File::size() const
{
struct stat st;
- if (::stat(path.c_str(), &st) != 0) {
+ if (::lstat(path.c_str(), &st) != 0) {
throw runtime::Exception(runtime::GetSystemErrorMessage());
}