+2005-01-31 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * fs_extras.C: add changes from Asgers Win32 patch.
+
2005-01-31 Asger Ottar Alstrup <aalstrup@laerdal.dk>
* chdir.C (chdir):
2005-01-31 Lars Gullik Bjonnes <larsbj@gullik.net>
- * Makefile.am (libsupport_la_SOURCES): remove rmdir.C
+ * Makefile.am (libsupport_la_SOURCES): remove rmdir.C
* rmdir.C: delete file
* lyxlib.h: remove rmdir decl
-
+
2005-01-31 Lars Gullik Bjonnes <larsbj@gullik.net>
* .cvsignore: add package.C
#ifdef BOOST_POSIX
return ::access(ph.string().c_str(), R_OK) == 0;
#endif
+#ifdef BOOST_WINDOWS
+ DWORD const attr = ::GetFileAttributes(ph.string().c_str());
+ return attr != INVALID_FILE_ATTRIBUTES &&
+ (attr & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY;
+#endif
}
#ifdef BOOST_POSIX
return ::access(ph.string().c_str(), W_OK) == 0;
#endif
+#ifdef BOOST_WINDOWS
+ DWORD const attr = ::GetFileAttributes(ph.string().c_str());
+ if (attr != INVALID_FILE_ATTRIBUTES &&
+ (attr & FILE_ATTRIBUTE_READONLY) != 0) {
+ // Read-only - no write access
+ return false;
+ }
+ return attr != INVALID_FILE_ATTRIBUTES &&
+ (attr & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY;
+#endif
}
#ifdef BOOST_POSIX
return is_readable(ph) && !is_writable(ph);
#endif
+#ifdef BOOST_WINDOWS
+ DWORD const attr = ::GetFileAttributes(ph.string().c_str());
+ return (attr != INVALID_FILE_ATTRIBUTES
+ && (attr & FILE_ATTRIBUTE_READONLY));
+#endif
}
source, target,
fs::detail::system_error_code()));
#endif
+#ifdef BOOST_WINDOWS
+ if (::CopyFile(source.string().c_str(), target.string().c_str(), !noclobber) == 0) {
+ boost::throw_exception(
+ filesystem_error(
+ "boost::filesystem::copy_file",
+ source, target,
+ fs::detail::system_error_code()));
+ }
+#endif
}
-
}
}