aboutsummaryrefslogtreecommitdiff
path: root/lib/std/fs
AgeCommit message (Collapse)Author
2021-01-11std.EarlyEOFReader: rename to LimitedReaderAndrew Kelley
2021-01-11std: use fifo.pump in writeFileAllUnseekabledaurnimator
2021-01-11std: use reader.skipBytes to avoid infinite loop in writeFileAllUnseekabledaurnimator
skipBytes correctly handles EOF for us
2021-01-11Merge pull request #7134 from alexnask/fix_std_fs_watchAndrew Kelley
The std.fs.Watch rewrite PR
2021-01-11update path.join to recognize any separators that isSep doesTravis
2021-01-08Remove deprecated stream aliasesJay Petacat
2021-01-07remove z/Z format specifiersJonathan Marler
Zig's format system is flexible enough to add custom formatters. This PR removes the new z/Z format specifiers that were added for printing Zig identifiers and replaces them with custom formatters.
2021-01-05stage2: link.C: use pwritevAndrew Kelley
2021-01-02convert more {} to {d} and {s}Andrew Kelley
2021-01-01Merge pull request #7578 from vrischmann/walkerAndrew Kelley
fix segfault in std.fs.Walker
2020-12-31Year++Frank Denis
2020-12-28fs: add a test for the walkerVincent Rischmann
Written like this it triggers the segfault reported in #7560
2020-12-23std: fix compile errors introduced in previous commitAndrew Kelley
2020-12-23rework std.ResetEvent, improve std lib Darwin integrationAndrew Kelley
* split std.ResetEvent into: - ResetEvent - requires init() at runtime and it can fail. Also requires deinit(). - StaticResetEvent - can be statically initialized and requires no deinitialization. Initialization cannot fail. * the POSIX sem_t implementation can in fact fail on initialization because it is allowed to be implemented as a file descriptor. * Completely define, clarify, and explain in detail the semantics of these APIs. Remove the `isSet` function. * `ResetEvent.timedWait` returns an enum instead of a possible error. * `ResetEvent.init` takes a pointer to the ResetEvent instead of returning a copy. * On Darwin, `ResetEvent` is implemented using Grand Central Dispatch, which is exposed by libSystem. stage2 changes: * ThreadPool: use a single, pre-initialized `ResetEvent` per worker. * WaitGroup: now requires init() and deinit() and init() can fail. - Add a `reset` function. - Compilation initializes one for the work queue in creation and re-uses it for every update. - Rename `stop` to `finish`. - Simplify the implementation based on the usage pattern.
2020-12-22cast sendto to SendError inside send (#7481)luna
* cast sendto to SendError inside send * remove WouldBlock from SendToError * add missing ENOTCONN mapping * remove SystemResources duplicate * move NetworkUnreachable to SendError * add NetworkSubsystemFailed to SendError * Use zig's implicit error set casting Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2020-12-16Fix compilation for MacOSAlexandros Naskos
2020-12-15create SendToError (#7417)luna
* add SendToError * remove error catch * add missing SendToError entries * add mappings to new errors for posix * map windows sendto() errors
2020-12-14Implement std.fs.Watch on WindowsAlexandros Naskos
Use unmanaged containers in std.fs.Watch
2020-12-14Fixed std.fs.Watch implementation on LinuxAlexandros Naskos
Added .Deleted event to std.fs.Watch on Linux
2020-12-11std.fs.path.extension: different behavior for ending dotAndrew Kelley
extension("a.") now returns "." instead of "". This matches both Python and Node.js standard library behavior as well as my personal opinion on how this function should be defined. Apologies for missing this in the code review.
2020-12-11std.fs.path.extension: add additional API guaranteeAndrew Kelley
Added: The returned slice is guaranteed to have its pointer within the start and end pointer address range of `path`, even if it is length zero.
2020-12-11Merge pull request #7098 from MasterQ32/std.fs.path.extensionAndrew Kelley
Implements std.fs.path.extension
2020-12-07add AddressFamilyNotSupported to SendErrorLuna
2020-12-04std: Restore file locking test on WindowsLemonBoy
Make it even more robust wrt timing problems. Closes #7010
2020-11-27Add readAllArrayListAligned to Reader which can accept an arbitrary alignmentchristian-stephen
2020-11-23std: Fix file locking logic for BSD targetsLemonBoy
2020-11-18std: openDirAbsolute and accessAbsolute (#7082)g-w1
* add more abosolutes * added wrong files * adding 2 tests and changing the function signatures because of lazy analysis not checking them * fix a bug that got uncovered by lazy eval * Add compile error when using WASI with openDirAbsolute and accessAbsolute * typo
2020-11-18Changes behaviour from std.fs.path.extension from returning `null` to ↵Felix (xq) Queißner
returning `""`.
2020-11-14Adapts to @andrewrk​s comment to include dot.Felix (xq) Queißner
2020-11-13std.fs.path.dirname: return null when input path is rootAndrew Kelley
This intentionally diverges from the unix dirname command, as well as Python and Node.js standard libraries, which all have this edge case return the input path, unmodified. This is a footgun, and nobody should have ever done it this way. Even the man page contradicts the behavior. It says: "strip last component from file name". Now consider, if you remove the last item from an array of length 1, then you have now an array of length 0. After you strip the last component, there should be no components remaining. Clearly, returning the input parameter unmodified in this case does not match the documented behavior. This is my justification for taking a stand on this API design. closes #6746 closes #6727 closes #6584 closes #6592 closes #6602
2020-11-13openbsd: skip tests using Dir.realpathSébastien Marie
2020-11-13Makes @haze happy.Felix (xq) Queißner
2020-11-13Respects leading `.` and ignores it.Felix (xq) Queißner
2020-11-13Implements std.fs.path.extension.Felix (xq) Queißner
2020-11-06disable flaky file locking test on WindowsAndrew Kelley
See #7010
2020-11-06std: Make file locking tests less fragileLemonBoy
2020-11-03std.fs.File.writeFileAll: support unseekable filesAndrew Kelley
With this commit, the function tries to use more efficient syscalls, and then falls back to non-positional reads. The motivating use case for this change is to support something like the following: try io.getStdOut().writeFileAll(dest_file, .{});
2020-10-17Merge branch 'master' into openbsd-minimalSebastien Marie
2020-10-12disable the failing std lib freebsd testsAndrew Kelley
enable std lib freebsd tests on the CI See #1759
2020-10-12Rename .macosx to .macosVignesh Rajagopalan
2020-10-11add minimal openbsd supportSébastien Marie
2020-10-07fixups for the previous commitAndrew Kelley
* std.fs.File.copyRange and copyRangeAll return u64 instead of usize - the returned value is how much of the `len` is transferred, so the types should match. This removes the need for an `@intCast`. * fix typo that removed a subtraction * Fix the size of codegen.AnyMCValue which gave me a compile error when I tried to build self-hosted for i386-linux. * restore the coercion to u64 of syms_sect.sh_info. We want to make sure the multiplication happens with 64 bits and not the smaller type used by the ELF format. * fix another offset parameter in link/Elf.zig to be u64 instead of usize * add a nice little TODO note to help out Jakub * FmtError already has FileTooBig in it; we just need to return it.
2020-10-06Fix building the zig compiler for 32-bit targetsTimon Kruiper
2020-09-30Add deleteDir test with exception for not-empty directory on WindowsRyan Liptak
Re-adds the test that was added and then reverted in https://github.com/ziglang/zig/pull/6397, but with the test for https://github.com/ziglang/zig/issues/5537 skipped for now since that issue is no longer fixed.
2020-09-29Revert "Fix for Windows: std.os.windows.DeleteFile()"Jakub Konka
2020-09-27Merge pull request #6397 from suirad/fix-5537Jakub Konka
Fix for Windows: std.os.windows.DeleteFile()
2020-09-25Stdlib fix for os.windows.deleteFile to fail withSuirad
a proper error when attempting to delete a directory that isnt empty
2020-09-25Remove noop checkLoris Cro
Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2020-09-24pwritevLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24pwriteLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>