]> git.lyx.org Git - lyx.git/blobdiff - src/support/filetools.C
lyx-devel.diff
[lyx.git] / src / support / filetools.C
index f843494cddcc75deede22d4f2d656a8840207772..b9de57da7b8d278da317a2ffd208ca7bba6fefe3 100644 (file)
@@ -32,7 +32,6 @@
 #include "lyx_gui_misc.h"
 #include "FileInfo.h"
 #include "support/path.h"        // I know it's OS/2 specific (SMiyata)
-#include "support/syscall.h"
 #include "gettext.h"
 #include "lyxlib.h"
 
@@ -68,13 +67,13 @@ extern string system_tempdir;
 
 bool IsLyXFilename(string const & filename)
 {
-       return contains(filename, ".lyx");
+       return suffixIs(filename, ".lyx");
 }
 
 
 bool IsSGMLFilename(string const & filename)
 {
-       return contains(filename, ".sgml");
+       return suffixIs(filename, ".sgml");
 }
 
 
@@ -442,7 +441,7 @@ string const CreateTmpDir(string const & tempdir, string const & mask)
        // safe because of the gap between unlink and mkdir. (Lgb)
        lyx::unlink(tmpfl.c_str());
        
-       if (tmpfl.empty() || lyx::mkdir(tmpfl, 0777)) {
+       if (tmpfl.empty() || lyx::mkdir(tmpfl, 0700)) {
                WriteFSAlert(_("Error! Couldn't create temporary directory:"),
                             tempdir);
                return string();
@@ -648,21 +647,6 @@ string const OnlyFilename(string const & fname)
 }
 
 
-// Strips filename from path
-string const BasePath(string const & fname)
-{
-       if (fname.empty())
-               return fname;
-
-       string::size_type j = fname.rfind('/');
-       if (j == string::npos) // no '/' in fname
-               return string();
-
-       // Strip to basename
-       return fname.substr(0,j + 1);
-}
-
-
 // Is a filename/path absolute?
 bool AbsolutePath(string const & path)
 {