]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileInfo.C
various changes
[lyx.git] / src / support / FileInfo.C
index 2e2bf1c7f39aa8aa332cdd078161e7c072395545..baa460d493644167e2d495a185db3ca12316e7b2 100644 (file)
@@ -5,14 +5,19 @@
  *           LyX, The Document Processor
  *        
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-1999 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
 #include <config.h>
 
-#include <sys/types.h>
-#include <sys/stat.h>
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+//#include <sys/types.h>
+//#include <sys/stat.h>
+
 #include <cerrno>
 #include "FileInfo.h"
 
@@ -136,9 +141,9 @@ void FileInfo::init()
 void FileInfo::dostat(bool link)
 {
        if (link) {
-               status = lstat(fname.c_str(), &buf);
+               status = ::lstat(fname.c_str(), &buf);
        } else {
-               status = stat(fname.c_str(), &buf);
+               status = ::stat(fname.c_str(), &buf);
        }
        if (status) err = errno;
 }
@@ -167,6 +172,7 @@ FileInfo & FileInfo::newFile(int fildes)
 }
 
 
+// should not be in FileInfo
 char const * FileInfo::typeIndicator() const
 {
        if (S_ISDIR(buf.st_mode)) return ("/");
@@ -190,16 +196,8 @@ mode_t FileInfo::getMode() const
        return buf.st_mode;
 }
 
-long FileInfo::getBlockSize() const
-{
-#ifndef __EMX__
-       return buf.st_blksize; /* Preferred I/O block size */
-#else
-#warning May be fixed in 0.13 (SMiyata)
-       return 512; /* Assume HPFS */
-#endif
-}
 
+// should not be in FileInfo
 void FileInfo::modeString(char * szString) const
 {
        szString[0] = typeLetter();
@@ -211,6 +209,7 @@ void FileInfo::modeString(char * szString) const
 }
 
 
+// should not be in FileInfo
 char FileInfo::typeLetter() const
 {
 #ifdef S_ISBLK
@@ -238,7 +237,8 @@ char FileInfo::typeLetter() const
 }
 
 
-void FileInfo::flagRWX(unsigned short i, char * szString) const
+// should not be in FileInfo
+void FileInfo::flagRWX(mode_t i, char * szString) const
 {
        szString[0] = (i & S_IRUSR) ? 'r' : '-';
        szString[1] = (i & S_IWUSR) ? 'w' : '-';
@@ -246,6 +246,7 @@ void FileInfo::flagRWX(unsigned short i, char * szString) const
 }
 
 
+// should not be in FileInfo
 void FileInfo::setSticky(char * szString) const
 {
 #ifdef S_ISUID
@@ -281,7 +282,7 @@ time_t FileInfo::getAccessTime() const
 }
 
 
-time_t  FileInfo::getStatusChangeTime() const
+time_t FileInfo::getStatusChangeTime() const
 {
        return buf.st_ctime;
 }
@@ -372,7 +373,8 @@ bool FileInfo::isSocket() const
 }
 
 
-bool FileInfo::access(int p)
+// should not be in FileInfo
+bool FileInfo::access(int p) const
 {
        // if we don't have a filename we fail
        if (fname.empty()) return false;
@@ -385,3 +387,6 @@ bool FileInfo::access(int p)
                return false;
        }
 }
+
+
+