Files
Nim/lib/pure
c-blake d070ccbc03 Fix closeHandle bug, add setFileSize, make resize work on Windows (#21375)
* Add general purpose `setFileSize` (unexported for now).  Use to simplify
`memfiles.open` as well as make robust (via hard allocation, not merely
`ftruncate` address space allocation) on systems with `posix_fallocate`.

As part of this, fix a bad `closeHandle` return check bug on Windows and
add `MemFile.resize` for Windows now that setFileSize makes that easier.

* Adapt existing test to exercise newly portable `MemFile.resize`.

* Since Apple has never provided `posix_fallocate`, provide a fallback.
This is presently written in terms of `ftruncate`, but it can be
improved to use `F_PREALLOCATE` instead, as mentioned in a comment.

(cherry picked from commit c91ef1a09f)
2023-02-16 16:37:44 +01:00
..
2021-09-02 12:10:14 +02:00
2021-08-31 08:14:05 +02:00
2021-02-23 21:05:39 -08:00
2015-10-01 12:05:45 -07:00
2021-02-23 21:05:39 -08:00
2021-07-13 09:22:33 +02:00
2021-04-08 14:08:58 +02:00
2018-04-06 11:59:49 +02:00
2021-01-09 00:24:41 +01:00
2021-10-01 13:57:06 +02:00
2021-03-10 10:39:23 -08:00
2021-08-19 11:35:40 +02:00
2021-04-06 22:08:59 +02:00
2021-09-19 23:35:50 +02:00
2021-02-24 21:47:27 -08:00
2021-05-04 13:13:23 +02:00
2023-02-16 10:56:56 +01:00
2021-02-21 00:27:39 -08:00
2021-02-21 00:27:39 -08:00
2021-07-20 12:50:43 +02:00
2021-08-23 00:13:39 +02:00
2021-12-31 05:13:46 +01:00
2021-10-07 12:01:27 +02:00
2021-02-22 09:40:11 +01:00
2021-10-05 12:29:59 +02:00
2021-04-26 09:04:52 +02:00
2021-02-08 09:46:07 +01:00
2020-11-23 19:53:57 +01:00