From ff7f0587dfc90bc2bc80365eff80f2a0835b791e Mon Sep 17 00:00:00 2001 From: Peter Kuemmel Date: Mon, 23 Jan 2012 21:42:50 +0100 Subject: no error code about too long file names on Windows --- src/disk_interface.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/disk_interface.cc b/src/disk_interface.cc index 4e10f4e..6a14069 100644 --- a/src/disk_interface.cc +++ b/src/disk_interface.cc @@ -67,6 +67,12 @@ bool DiskInterface::MakeDirs(const string& path) { TimeStamp RealDiskInterface::Stat(const string& path) { #ifdef _WIN32 + // MSDN: "Naming Files, Paths, and Namespaces" + // http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx + if (!path.empty() && path[0] != '\\' && path.size() > MAX_PATH) { + Error("Stat(%s): Filename longer than %i characters", path.c_str(), MAX_PATH); + return -1; + } _WIN32_FILE_ATTRIBUTE_DATA attrs; if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &attrs)) { DWORD err = GetLastError(); -- cgit v0.12