Commit Graph

8 Commits

Author SHA1 Message Date
Luke Dashjr
990ff83c56 Merge ionice_win 2025-03-05 03:27:08 +00:00
Luke Dashjr
ac2190c22a utilioprio: Add Windows support as ioprio_set_file_idle 2025-03-05 17:23:03 +00:00
Vasil Dimov
06105d8da8 util: explicitly close all AutoFiles that have been written
There is no way to report a close error from `AutoFile` destructor.
Such an error could be serious if the file has been written to because
it may mean the file is now corrupted (same as if write fails).

So, change all users of `AutoFile` that use it to write data to
explicitly close the file and handle a possible error.

Github-Pull: #29307
Rebased-From: dba783538683cfc6af209c640c2d019648493f31
2024-11-09 19:18:20 +00:00
Pieter Wuille
ff95cb31da
streams: remove AutoFile::Get() entirely
Co-Authored-By: David Gumberg <davidzgumberg@gmail.com>

Github-Pull: bitcoin/bitcoin#30884
Rebased-From: a240e150e8
2024-09-16 23:10:17 -04:00
Pieter Wuille
8229e98116
streams: cache file position within AutoFile
Github-Pull: bitcoin/bitcoin#30884
Rebased-From: e624a9bef1
2024-09-16 23:10:14 -04:00
Ava Chow
ca18aea5c4 Add AutoFile::seek and tell
It's useful to be able to seek to a specific position in a file. Allow
AutoFile to seek by using fseek.

It's also useful to be able to get the current position in a file.
Allow AutoFile to tell by using ftell.
2024-04-01 14:37:24 -04:00
MarcoFalke
fa633aa690
streams: Teach AutoFile how to XOR 2023-07-19 18:12:42 +02:00
MarcoFalke
000019e158
Add AutoFile::detail_fread member function
New code can call the method without having first to retrieve the raw
FILE* pointer via Get().

Also, move implementation to the cpp file. Can be reviewed with:
--color-moved=dimmed-zebra  --color-moved-ws=ignore-all-space
2023-07-13 11:51:07 +02:00