Henry Kupty
7bee39c1fd
test: enter after check to preserve depth
2025-10-03 16:29:08 -07:00
Henry Kupty
a26a654c55
test: Include expected depth test
2025-10-03 16:29:08 -07:00
Henry Kupty
df394faf77
feat: Reintroduce depth
...
Some decision-making might depend on the level of the traversal, so
it makes sense to expose depth here since it's stable, and not in the
automatic walker where it's not.
2025-10-03 16:29:08 -07:00
Ryan Liptak
760127a760
Add SelectiveWalker/walkSelectively and implement Walker in terms of it
...
This is a breaking change, since the fields of Walker have changed. The function APIs are unchanged, though.
2025-10-03 16:29:08 -07:00
rpkak
bc512648db
use copy_file_range syscall on linux
2025-09-24 03:08:12 +02:00
Andrew Kelley
1d764c1fdf
Revert "Merge pull request #24905 from gooncreeper/file-reader-buffered"
...
This reverts commit ac42eaaadd , reversing
changes made to 9fa2394f8c .
I would like a chance to review this, please. I already spotted some
issues.
2025-09-05 11:26:38 -07:00
Isaac Freund
ac42eaaadd
Merge pull request #24905 from gooncreeper/file-reader-buffered
...
Fix Io.Writer sendFile bugs with buffered reader contents
2025-09-05 16:28:08 +02:00
Andrew Kelley
f78f70dbd8
std.fs.File.Writer: break up seekTo
...
- introduce seekToUnbuffered which asserts no buffered data and does not
have WriteFailed in the error set
- remove WriteFailed from SeekError
- make seekTo based on calling flush and then seekToUnbuffered
- revert the change to reset seek_err since the error sets are
compatible again
2025-09-04 16:05:55 -07:00
Kendall Condon
58dda3b10b
fix sendFile implementations bypassing interface buffer
...
Also removes `File.Reader.read` since it is otherwise unused and is a
footgun.
2025-09-04 17:26:49 -04:00
Kendall Condon
7687b916fd
File.Writer.sendFile: properly update reader pos
...
seekBy affects the reader's physical position, not its logical
position.
2025-09-04 16:38:50 -04:00
Josh GM Walker
b1189ab038
fix: std.fs.File.Writer.seekTo does not flush ( #25135 )
...
* add failing test case
* perform flush and allow error
* dont over constrain flush error
* reset seek error during conversion
2025-09-03 21:43:47 -07:00
Andrew Kelley
150169f1e0
std.fmt: delete deprecated APIs
...
std.fmt.Formatter -> std.fmt.Alt
std.fmt.format -> std.Io.Writer.print
2025-08-31 12:49:18 -07:00
Andrew Kelley
9a0970a12b
rework std.Io.Writer.Allocating to support runtime-known alignment
...
Also, breaking API changes to:
* std.fs.Dir.readFileAlloc
* std.fs.Dir.readFileAllocOptions
2025-08-30 00:48:50 -07:00
Andrew Kelley
79f267f6b9
std.Io: delete GenericReader
...
and delete deprecated alias std.io
2025-08-29 17:14:26 -07:00
Andrew Kelley
57dbc9e74a
std.Io: delete GenericWriter
2025-08-28 18:30:57 -07:00
Alex Rønne Petersen
77c09d16f9
std.fs.Dir: fix updateFile() to flush the file before updating its times
...
AtomicFile.finish() calls flush() which renders any previous updateTimes() calls
useless. Regression introduced in f2a3ac7c05 .
Closes #24927 .
2025-08-23 12:32:14 -07:00
Carl Åstholm
172e97154d
Use readStreaming, not readPositional, for streaming file readVec on Windows
2025-08-20 21:49:07 +02:00
Carl Åstholm
9e9cb3ad6d
Fix bugs in Windows readVec implementations
2025-08-19 16:18:02 -07:00
Andrew Kelley
ef14c73245
Compilation: remove last instance of deprecatedReader
...
This also makes initStreaming preemptively disable file size checking.
2025-08-16 14:46:20 -07:00
Andrew Kelley
e395c24c6d
std.fs.File.Reader: fix freestanding build failures
...
This should be enough to unblock people for now. We'll revisit the way
these things are organized with the upcoming std.Io interface.
fixes #24685
2025-08-14 23:10:29 -07:00
Andrew Kelley
6bcdcf85c7
std.fs.File.Writer.sendFile: handle sendfile errors
...
fixes #24842
2025-08-13 22:16:08 -07:00
Andrew Kelley
5e986fef1f
std.fs.File.Reader: fix seekBy
...
Tested locally:
stage3/bin/zig build test -Dskip-release -Dskip-non-native
closes #24495
closes #24498
closes #24713
2025-08-13 12:24:14 -07:00
Andrew Kelley
749f10af49
std.ArrayList: make unmanaged the default
2025-08-11 15:52:49 -07:00
Andrew Kelley
282c3575b1
std.fs.File: prefer getSize over getEndPos
...
The former detects when it is appropriate to switch to streaming mode.
closes #24798
2025-08-11 12:27:52 -07:00
Andrew Kelley
b9a6dae2ae
std.fs.File.Reader.getSize: check file kind on stat
...
closes #24794
2025-08-10 17:51:22 -07:00
Andrew Kelley
e667884f9b
std.net.Stream.Reader: init size_err
...
This code knows in advance that stat() should never be called.
closes #24754
2025-08-10 17:38:46 -07:00
Andrew Kelley
5998a8cebe
Merge pull request #24698 from ziglang/http
...
std: rework HTTP and TLS for new I/O API
2025-08-07 19:54:25 -07:00
TibboddiT
2cf15bee03
Fix some libc version checks for Bionic
2025-08-08 01:26:00 +00:00
Andrew Kelley
172d31b0e2
std.fs.File.Reader: fix readVec fill
...
respect the case when there is existing buffer
2025-08-07 10:04:52 -07:00
Andrew Kelley
04fe1bfe3c
std.Io.Reader: use readVec for fill functions
...
readVec has two updated responsibilities:
1. it must respect any existing already buffered data.
2. it must write to the buffer if data is empty
2025-08-06 21:23:06 -07:00
Andrew Kelley
111305678c
std: match readVec fn prototype exactly
...
this is not necessary according to zig language, but works around a flaw
in the C backend
2025-07-31 22:10:11 -07:00
Andrew Kelley
f3a38e30fa
std.Io: delete SeekableStream
...
Alternative is to use File.Reader and File.Writer directly.
2025-07-31 22:10:11 -07:00
Andrew Kelley
cf7a28febb
std.Io.Reader: introduce readVec back into the VTable
...
simplifies and fixes things
addresses a subset of #24608
2025-07-30 09:26:34 -07:00
Andrew Kelley
733b208256
std.posix.ftruncate: handle NonResizable properly
2025-07-25 14:15:33 -07:00
Andrew Kelley
da51e94d50
std.fs.File.end: account for streaming mode
2025-07-25 14:15:33 -07:00
Jacob Young
5060ab99c9
aarch64: add new from scratch self-hosted backend
2025-07-22 19:43:47 -07:00
Andrew Kelley
34d2778239
std.fs.File.Reader.sendFile: fix 32-bit freebsd
2025-07-22 09:39:24 -07:00
Andrew Kelley
76fe518d49
std.fs.File.Reader.sendFile: fix EndOfStream detection
2025-07-21 23:33:19 -07:00
Andrew Kelley
96cbdd145d
std.fs.File.Reader: fix sendFile logic
...
it wasn't accounting for both writer and reader buffering
2025-07-21 20:00:45 -07:00
Andrew Kelley
b35c55e237
std.fs.File.Reader: fix seek position logic
2025-07-21 18:14:21 -07:00
Andrew Kelley
fe10c66d66
std.fs.File.Reader: only fcopyfile if size available
2025-07-21 12:32:37 -07:00
Andrew Kelley
f1576ef14c
objcopy: delete most of it
...
this code is not up to zig project standards
tracked by #24522
oh, and fix not adjusting buffer seek position in std.fs.File.Reader
2025-07-21 12:32:37 -07:00
Andrew Kelley
f2a3ac7c05
std.fs.File: delete writeFileAll and friends
...
please use File.Writer for these use cases
also breaking API changes to std.fs.AtomicFile
2025-07-21 12:32:37 -07:00
Andrew Kelley
9abc3232a8
std.fs.File.Reader: fix missed advance writer positions
2025-07-21 13:08:43 +02:00
Andrew Kelley
b510482525
std.fs.File.Reader.seekTo: add missing int cast
2025-07-14 00:21:20 -07:00
Atlas Yu
2cda4cfb39
std.posix.send: should expect ConnectionRefused
...
Closes : #20219
2025-07-11 13:06:13 +02:00
Linus Groh
eb37552536
Remove numerous things deprecated during the 0.14 release cycle
...
Basically everything that has a direct replacement or no uses left.
Notable omissions:
- std.ArrayHashMap: Too much fallout, needs a separate cleanup.
- std.debug.runtime_safety: Too much fallout.
- std.heap.GeneralPurposeAllocator: Lots of references to it remain, not
a simple find and replace as "debug allocator" is not equivalent to
"general purpose allocator".
- std.io.Reader: Is being reworked at the moment.
- std.unicode.utf8Decode(): No replacement, needs a new API first.
- Manifest backwards compat options: Removal would break test data used
by TestFetchBuilder.
- panic handler needs to be a namespace: Many tests still rely on it
being a function, needs a separate cleanup.
2025-07-11 08:17:43 +02:00
Andrew Kelley
5360968e03
std: rename io to Io in preparation
...
This commit is non-breaking.
std.io is deprecated in favor of std.Io, in preparation for that
namespace becoming an interface.
2025-07-11 01:16:27 +02:00
Andrew Kelley
55bced9563
std.fs.File.Writer: fix splat alias bug
...
same deal as previous commit
2025-07-09 20:01:15 -07:00
Andrew Kelley
5955ba4f53
std.fs.File.Writer: implement positional writing for Windows
2025-07-07 23:09:14 -07:00