fixed GH #1523: Long path names under Windows

This commit is contained in:
Günter Obiltschnig
2017-02-02 20:54:59 +01:00
parent 960649d0ba
commit 43a0490a70
12 changed files with 98 additions and 17 deletions

View File

@@ -50,6 +50,19 @@ class Path;
class Foundation_API File: private FileImpl
/// The File class provides methods for working with a file.
///
/// Regarding paths passed to the various methods, note that
/// platform-specific limitations regarding maximum length
/// of the entire path and its components apply.
///
/// On Windows, if compiled with UTF-8 support (POCO_WIN32_UTF8)
/// the implementation tries to work around the rather low
/// 260 characters MAX_PATH limit by adding the "\\?\" prefix if
/// a path is absolute and exceeds MAX_PATH characters in length.
/// Note that various limitations regarding usage of the "\\?\"
/// prefix apply in that case, e.g. the path must
/// not contain relative components ("." and "..") and must not
/// use the forward slash ("/") as directory separator.
{
public:
typedef FileSizeImpl FileSize;

View File

@@ -60,6 +60,7 @@ protected:
bool createFileImpl();
bool createDirectoryImpl();
static void handleLastErrorImpl(const std::string& path);
static void convertPath(const std::string& utf8Path, std::wstring& utf16Path);
private:
std::string _path;
@@ -68,6 +69,8 @@ private:
friend class FileHandle;
friend class DirectoryIteratorImpl;
friend class WindowsDirectoryWatcherStrategy;
friend class FileStreamBuf;
friend class LogFileImpl;
};

View File

@@ -60,6 +60,7 @@ protected:
bool createFileImpl();
bool createDirectoryImpl();
static void handleLastErrorImpl(const std::string& path);
static void convertPath(const std::string& utf8Path, std::wstring& utf16Path);
private:
std::string _path;
@@ -67,6 +68,8 @@ private:
friend class FileHandle;
friend class DirectoryIteratorImpl;
friend class FileStreamBuf;
friend class LogFileImpl;
};