]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileInfo.C
fix a couple of hard crashes, constify local variables, whitespace changes, some...
[lyx.git] / src / support / FileInfo.C
index 79e33e839698a78ef02985f5b78aac5012860856..aade9e243a76802474702015aafbfc15345d113b 100644 (file)
@@ -5,12 +5,16 @@
  *           LyX, The Document Processor
  *        
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-1999 The LyX Team.
+ *           Copyright 1995-2000 The LyX Team.
  *
  * ====================================================== */
 
 #include <config.h>
 
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <cerrno>
@@ -136,9 +140,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;
 }
@@ -192,17 +196,6 @@ mode_t FileInfo::getMode() const
 }
 
 
-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
 {
@@ -244,7 +237,7 @@ char FileInfo::typeLetter() const
 
 
 // should not be in FileInfo
-void FileInfo::flagRWX(unsigned short i, char * szString) const
+void FileInfo::flagRWX(mode_t i, char * szString) const
 {
        szString[0] = (i & S_IRUSR) ? 'r' : '-';
        szString[1] = (i & S_IWUSR) ? 'w' : '-';
@@ -380,7 +373,7 @@ bool FileInfo::isSocket() const
 
 
 // should not be in FileInfo
-bool FileInfo::access(int p)
+bool FileInfo::access(int p) const
 {
        // if we don't have a filename we fail
        if (fname.empty()) return false;
@@ -393,3 +386,6 @@ bool FileInfo::access(int p)
                return false;
        }
 }
+
+
+