The CopyFileIfDifferent, CopyFileAlways, CopyAFile and CopyADirectory
methods should always copy permissions. The special cases in which a
caller would pass copyPermissions=false should be handled at the call
site. The parameter needlessly complicates the interface and semantics
of these methods.
On Windows 7 the file size reported by 'stat' on a new file sometimes
reports zero even though the real size is correct. This causes our
CopyFileAlways method to falsely detect copy failure. Work around the
problem by trusting the state of ofstream after writing the file.
This converts the KWSys license to a pure 3-clause OSI-approved BSD
License. We drop the previous license clause requiring modified
versions to be plainly marked. We also update the KWSys copyright to
cover the full development time range.
The commit "Fix KWSys SystemTools build on cygwin with -mwin32" tried to
restore the state of the _WIN32 definition that was broken by the commit
"Optimize KWSys SystemTools::FileExists on Windows". It did so for the
case of building with -mwin32 on cygwin, but since including <windows.h>
defines _WIN32, it failed for the case of not using -mwin32.
This commit restores the state of _WIN32 in all cases by undefining it
after including <windows.h> if it was not defined beforehand.
Commit "Optimize KWSys SystemTools::FileExists on Windows" accidentally
added "#undef _WIN32" when including <windows.h> on cygwin, which breaks
builds using the -mwin32 flag. This commit removes that line and fixes
the real error it was intended to avoid.
We optimize this method by using the GetFileAttributesExA native Windows
API to check for file existence when possible. For real Windows builds
we always use it. For Cygwin we use cygwin_conv_to_win32_path to get a
native Windows path if possible and otherwise fall back to 'access'.
Cygwin-to-Windows path conversion and cache by Wojciech Migda.
See issue #8826.
This teaches ConvertToUnixSlashes to convert VMS paths into posix-style
paths. We also set the DECC$FILENAME_UNIX_ONLY feature so the process
always sees posix-style paths on disk.
When SystemTools::GetParentDirectory was fixed to never remove the root
path component from a full path we violated an assumption made by
IsSubDirectory that eventually GetParentDirectory returns an empty
string. This led to an infinite loop if the potential parent directory
is empty, so we explicitly avoid that case.
The previous change to this method broke cases where the input path does
not exist. The SystemTools::GetParentDirectory method is redundant with
the more robust SystemTools::GetFilenamePath. This replaces its
implementation to just call GetFilenamePath.
On Windows the GetLongPathName API function does not work on some
filesystems even if the file exists. In this case we should just use
the original long path name and not the GetShortPathName result.
See issue #8480.
This patch from Philip Lowman teaches SystemTools::GetRealPath to deal
with paths that do not exist by dealing with the case that realpath
returns NULL. See issue #8423.
- Add an argument to registry read/write/delete methods to specify
a 32-bit or 64-bit view.
- Default is the bit-ness of the running program.
- See issue #7095.