summaryrefslogtreecommitdiffstats
path: root/src/disk_interface.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1901 from MartinBP/windows_case_sensitive_foldersJan Niklas Hasse2022-01-201-3/+4
|\ | | | | disk_interface: Improve the stat cache handling for case sensitive folders on Windows
| * disk_interface: Improve the stat cache handling for case sensitive folders ↵Martin Boye Petersen2021-01-021-3/+4
| | | | | | | | | | | | | | | | | | on Windows The path used as argument to FindFirstFileExA is no longer being converted to lowercase. By not converting the path to lower case, case sensitive folders will now be handled correctly. Case insensitive folders still works as expected because casing doesn't matter on those. All entries in the stat cache remains lowercase to avoid potential cache misses.
* | Fix ninja -t clean for directories on WindowsMischa Jonker2021-09-131-7/+24
| | | | | | | | | | | | | | | | | | remove() deletes both files and directories. On Windows we have to select the correct function (DeleteFile will yield Permission Denied when used on a directory) This fixes the behavior of ninja -t clean in some cases https://github.com/ninja-build/ninja/issues/828
* | disk_interface: Restore toleration of missing files in RemoveFile on WindowsBrad King2021-02-121-1/+8
| | | | | | | | | | | | | | | | Revise the logic from commit 2d7f7e55 (Delete read-only files on Windows, too, 2020-12-07) to check if `GetFileAttributes` or `DeleteFile` failed due either variant of the file/path-not-found error. Issue: #1886
* | disk_interface: Do not query bits of INVALID_FILE_ATTRIBUTESBrad King2021-02-121-5/+5
| |
* | disk_interface: Improve wrapping of comment in RemoveFileBrad King2021-02-121-3/+3
| |
* | Delete read-only files on Windows, tooJan Niklas Hasse2020-12-071-2/+19
|/ | | | Fixes main complaint of #1886.
* Add 'using namespace std;' to all cc files to prepare for removing it from ↵Michael Jones2020-09-301-0/+2
| | | | header files
* Include unistd.h in disk_interface.ccNico Weber2020-06-211-0/+2
| | | | stat() needs unistd.h in addition to sys/stat.h and sys/types.h per POSIX. At least one (hobby) OS does need unistd.h, so add an include for it.
* Use st_mtim if st_mtime is macro, fix #1510makepost2018-12-241-10/+4
| | | | | In POSIX.1-2008, sys_stat has a st_mtim member and a st_mtime backward compatibility macro. Should help avoid hardcoding platform detection.
* Merge pull request #1264 from gahr/DirName-compile-timeJan Niklas Hasse2018-11-131-3/+4
|\ | | | | DirName's separators and their length are known at compile time
| * DirName's separators and their length are known at compile timePietro Cerutti2017-04-111-3/+4
| |
* | Merge pull request #1457 from V-for-Vasili/AIX-supportJan Niklas Hasse2018-11-051-0/+2
|\ \ | | | | | | Port to AIX platform
| * | Port to AIX platform.Vasili Skurydzin2018-08-021-0/+2
| | | | | | | | | | | | Taking care of printf format specifiers and large files using compiler macros in configure.py
* | | Fix compilation on FreeBSD 11.2 (use st_mtim.tv_nsec)Simon Arlott2018-10-251-1/+1
|/ / | | | | | | | | | | | | | | ./src/disk_interface.cc: In member function 'virtual TimeStamp RealDiskInterface::Stat(const string&, std::__cxx11::string*) const': ./src/disk_interface.cc:216:51: error: 'struct stat' has no member named 'st_mtimensec'; did you mean 'st_mtim'? return (int64_t)st.st_mtime * 1000000000LL + st.st_mtimensec; ^~~~~~~~~~~~ st_mtim
* | Revert "Fix stat when subdirectory is a file"Fredrik Medley2018-04-091-2/+1
| | | | | | | | | | This reverts commit 6c864097ef11da366fb4070e6ab9f34d6a293766 and fixes the broken Appveyor builds on GitHub.
* | Merge pull request #1348 from ngg/winunicodeNico Weber2018-04-051-1/+1
|\ \ | | | | | | Fix building on Windows in UNICODE mode
| * | Fix building on Windows in UNICODE modeGergely Nagy2017-10-311-1/+1
| | |
* | | Merge pull request #1365 from moroten/fix-disk-interface-tests-64-bit-timestampNico Weber2018-04-051-1/+12
|\ \ \ | | | | | | | | Fix disk_interface_test.cc on Windows for 64-bit timestamp
| * | | Fix stat when subdirectory is a fileFredrik Medley2017-12-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Make sure that stat on Windows, both with and without cache, returns "missing file" when running stat on notadir/foo where notadir is a file.
| * | | Fix disk_interface_test.cc on Windows for 64-bit timestampFredrik Medley2017-12-191-0/+10
| |/ / | | | | | | | | | | | | subdir/subsubdir/.. seems to get the time of subdir/subsubdir on NTFS (Windows 7), not the time of subdir.
* | | Fix build on Solaris.alekseyshl2018-03-051-1/+2
|/ / | | | | | | Solaris also does not define struct stat's st_mtimensec field.
* | Fix some Windows troubles.Elliott Sales de Andrade2017-09-161-1/+1
| | | | | | | | | | Add parentheses so that constant does not overflow; include inttypes.h when using MinGW to get the proper macros.
* | Update checks for new stat fields.Elliott Sales de Andrade2017-09-161-4/+6
| | | | | | | | | | This uses the macros as defined by the man page, which, as noted in the comments, are defined correctly on as many libc's that I could check.
* | Read file timestamps in higher resolution.Elliott Sales de Andrade2017-09-161-5/+14
| | | | | | | | | | | | | | | | This uses nanoseconds on POSIX (±~292 years) and 100-ns increments on Windows (±~29247 years). The fallbacks to different structure fields is the only thing grabbed from #337, with a slight modification in implementation.
* | Work around mtime being set to 0 sometimesPatrick Griffis2017-06-181-0/+5
| |
* | Move stat metric to DiskInterfaceColin Cross2017-05-221-0/+2
|/ | | | | | | Stat is not always used through Node::Stat, it is often used directly through DiskInterface. THe next patches will cause it to be called even more often through DiskInterface, so move the metrics to DiskInterface.
* windows: replace deprecated GetVersionEx with recommended replacementNico Weber2016-11-081-12/+7
| | | | | | | | The recommended replacement VerifyVersionInfo should work with the same SDKs that GetVersionEx worked with (while the wrappers in VersionHelpers.h require a recent SDK). This patch should not change behavior, and it's not supposed to increase build requirements. If this makes things harder to build, please let me know.
* Expose more details in FileReader::ReadFile signatureBrad King2016-02-031-7/+7
| | | | | | Return a status so callers can distinguish a missing file from an empty file. This allows our VirtualFileSystem test infrastructure to report as missing any file for which it has no entry.
* Let Stat() have an err outparam instead of writing to stderr.Nico Weber2015-03-311-27/+23
| | | | | | | | | Also check for Stat() failure in a few more places. This way, ninja doesn't print two "ninja: error: " lines if stat() fails during a build. It also makes it easier to keep the stat tests quiet. Every caller of Stat() needs to explicitly log the error string if that's desired.
* Fix unknown pragma warningsDanny2014-09-281-0/+4
|
* add some parens to silence a gcc warningEvan Martin2014-08-041-1/+1
|
* try to fix stat()ing directories on windowsNico Weber2014-06-271-2/+0
|
* make Stat() a const methodNico Weber2014-06-191-1/+1
|
* use local definition of FindExInfoBasic for earlier sdksScott Graham2014-06-191-1/+4
|
* suppress warning on win8.1 sdkScott Graham2014-06-161-0/+3
|
* simplify statcache code moreNico Weber2014-06-161-15/+6
|
* only use FindExInfoBasic on win7+Nico Weber2014-06-161-2/+13
|
* s/hFind/find_handle/Nico Weber2014-06-151-5/+5
|
* add missing _WIN32 checksNico Weber2014-06-151-0/+2
|
* add some statcache testsNico Weber2014-06-151-5/+11
|
* Free cache memory once it's no longer used.Nico Weber2014-06-151-0/+16
| | | | | Doesn't slow down empty build times measurably, and saves some memory on non-empty builds.
* error checkingNico Weber2014-06-151-8/+11
|
* simplify more, move behind flagNico Weber2014-06-151-3/+1
|
* more minor cleanupsNico Weber2014-06-151-10/+6
|
* more minor cleanupsNico Weber2014-06-151-20/+7
|
* minor cleanupsNico Weber2014-06-151-56/+40
|
* Add a stat cache. Demo-quality, and disabled atm.Nico Weber2014-06-151-19/+100
|
* Merge pull request #699 from mostynb/avoid_useless_mkdir_failureNico Weber2014-04-071-0/+3
|\ | | | | don't Fail if trying to mkdir when the dir already exists
| * don't Fail if trying to mkdir when the dir already existsMostyn Bramley-Moore2014-01-071-0/+3
| |