]> git.lyx.org Git - lyx.git/blobdiff - src/support/os_unix.cpp
an example for the sweave module, prepared by Gregor Gorjanc
[lyx.git] / src / support / os_unix.cpp
index 2c3f3262fd1fa0277c9d34e8e514448ce881966d..eb8c1dfa4e3440433002c6ad76538ddd7b4687cd 100644 (file)
@@ -17,6 +17,9 @@
 #include "support/FileName.h"
 #include "support/lstrings.h"
 
+#include <limits.h>
+#include <stdlib.h>
+
 #ifdef __APPLE__
 #include <Carbon/Carbon.h>
 #endif
@@ -127,6 +130,12 @@ string const & nulldev()
 }
 
 
+bool is_terminal(io_channel channel)
+{
+       return isatty(channel);
+}
+
+
 shell_type shell()
 {
        return UNIX;
@@ -215,6 +224,14 @@ bool autoOpenFile(string const & filename, auto_open_mode const mode)
 #endif
 }
 
+
+string real_path(string const & path)
+{
+       char rpath[PATH_MAX + 1];
+       char * result = realpath(path.c_str(), rpath);
+       return FileName::fromFilesystemEncoding(result ? rpath : path).absFilename();
+}
+
 } // namespace os
 } // namespace support
 } // namespace lyx