47 Commits

Author SHA1 Message Date
kbkpbot
c72d77d8a4
os: fix os.File's tell/0 method for windows (fix #24217) (#24218) 2025-05-20 15:41:15 +03:00
Delyan Angelov
c5e8ad19df
builtin: implement a s.hex() method, allowing shortening s.bytes().hex() chains, and reducing the intermediate allocations; add tests for it (#22540) 2024-10-16 14:18:10 +03:00
yuyi
19f080ffb8
all: change single blank comment to blank line (#22016) 2024-08-09 14:55:58 +03:00
Delyan Angelov
32f7ec8cea
os: add os.write_lines/2 + tests, fix deprecation notice in read_bytes_into_newline in file_test.v (#21343) 2024-04-25 08:31:01 +03:00
Delyan Angelov
f172a040ef
ci: improve test robustness on windows (#21116) 2024-03-28 07:29:17 +02:00
Turiiya
f77bb32044
all: fix typos (#21089) 2024-03-25 12:18:27 +02:00
Delyan Angelov
672fe9b8eb tests: make v vlib/os/os_test.c.v pass on windows, for users != admin, skipping the os.symlink checks 2024-01-23 17:03:01 +02:00
Delyan Angelov
252540a1ea
os: add os.path_devnull (containing /dev/null on POSIX and \\.\nul on Windows) (#20439) 2024-01-08 18:00:36 +02:00
Dmitriy Mihaylenko
75c0c92759
os: fix os.open_file/3 wb mode creation of text files containing crlf on Windows (#20101) 2023-12-08 21:52:52 +02:00
Alexander Medvednikov
f09826e928 all: unwrap const() blocks 2023-11-25 10:02:51 +03:00
Joe C
757929392e
all: update attributes to use new syntax 2023-11-15 16:16:01 +11:00
Delyan Angelov
50c22b5a12
os: implement os.fd_is_pending/1, os.Process.pipe_read/1, os.Process.is_pending/1 (#19787) 2023-11-07 13:47:25 +02:00
Turiiya
e465f7490c
tests: cleanup legacy temp path (#19716) 2023-10-31 15:16:19 +02:00
Turiiya
9051ac8921
all: fix typos (#19634) 2023-10-23 21:21:15 +03:00
yuyi
caee3935a5
os: fix truncate() on windows (#18262) 2023-05-25 14:37:53 +03:00
yuyi
190f5c69ea
os: fix open_file() on windows (fix #18245) (#18253) 2023-05-25 02:50:52 +02:00
Delyan Angelov
3625a74ec5
os: add test for os.open_append (#16846)
* os: add test for os.open_append

* fix unclosed file in test_eof (it made os.open_append fail only on windows, since it got the previous file content, because the file was locked, and os.rm could not delete it)
2023-01-03 01:11:35 +02:00
Felipe Pena
6a179a2926
checker: add int signedness mismatch checking for function call arguments (#16750) 2022-12-24 06:28:35 +02:00
yuyi
ef5be22f81
all: replace generic <> with [] - part 2 (#16536) 2022-11-26 18:23:26 +02:00
Delyan Angelov
9bb1867be0
os: refactor err == IError(os.Eof{}) to err is os.Eof 2022-11-16 00:53:45 +02:00
Delyan Angelov
f427a5241a
os,tools: add os.vtmp_dir()
Use it to consistently place all temporary files created by tests in a overridable folder specific to the user, that is easy to cleanup later.

NOTE: os.temp_dir() on macos returns `/tmp`, and using `/tmp/v` is a problem when multiple unix users are trying to access/create/write to it.
2022-11-03 10:19:51 +02:00
yuyi
f6844e9766
all: change optional to result of io (#16075) 2022-10-16 09:28:57 +03:00
yuyi
c3548c9413
tests: omit testsuite_begin/end() optional (#15871) 2022-09-25 10:29:25 +03:00
yuyi
d624ad50a7
os: fix file.read() (#15861) 2022-09-24 08:58:55 +03:00
yuyi
41dbd12bc4
tests: make error handling the same as the main function (#15825) 2022-09-21 19:45:43 +03:00
Delyan Angelov
8f98f1db9e
os: fix os.open_file('text.txt', 'wb', 0o666), add test (#15420) 2022-08-14 09:50:05 +03:00
Vincenzo Palazzo
b01f71d9da
io: migrate the Reader API to Result instead of Option (#15229) 2022-08-08 02:33:25 +03:00
Reuben Thomas
ed56c3957e
os: add File.reopen and File.eof methods (#15184) 2022-07-28 16:21:23 +03:00
Daniel Däschle
d679146a80
fmt: remove space in front of ? and ! (#14366) 2022-05-13 06:56:21 +03:00
Alexander Medvednikov
fbb9e65c0f all: ~500 more byte=>u8 2022-04-15 18:25:45 +03:00
Alexander Medvednikov
fb192d949b all: replace []byte with []u8 2022-04-15 15:35:35 +03:00
Alexander Medvednikov
d4a0d6f73c all: byte => u8 2022-04-15 14:58:56 +03:00
Tim Basel
9d0a5942ac
builtin: change IError msg and code to methods + fix vlib, add a deprecation notice for the old usages (#13041) 2022-02-11 15:52:33 +02:00
Delyan Angelov
7a0dc60d04
os: re-add the leak in os.join_path (the os.join_path(x, ...arr) case should be handled by V). Add a memleak free os.join_path_single version. 2021-11-22 14:40:55 +02:00
Alexander Medvednikov
f731060caf all: update chmod/chdir usages 2021-08-28 10:23:01 +03:00
Delyan Angelov
44828cbb29
ci: fix -cstrict job 2021-07-22 18:47:23 +03:00
Delyan Angelov
b537c9f624 tests: add a separate File.tell() test 2021-07-22 16:25:23 +03:00
Delyan Angelov
9171c1131e
ci: skip a failing f.tell() test on macos only 2021-07-22 13:28:00 +03:00
Delyan Angelov
d7dcb47db3
os: implement File.seek/2 and File.tell/0 2021-07-22 08:00:21 +03:00
yuyi
c4b5805890
checker: check generic method call args mismatch (#10669) 2021-07-05 10:14:00 +03:00
Sebastian Schicho
04ea2824d3
os: implement File.read_bytes_into_newline method for reading into a buffer, line by line (#10129) 2021-05-21 13:18:08 +03:00
Leigh McCulloch
49deeac71e
os: fix file read end-of-file detection (#10070) 2021-05-13 09:48:55 +03:00
Delyan Angelov
fec89c7efb
ci: fix some of v test-cleancode 1 2021-04-05 20:47:32 +03:00
Enzo
99abd46ac9
os: add (read|write)_raw[_at] to File (#9171) 2021-03-10 18:45:12 +02:00
Lukas Neubert
fdcfe397d4
fmt: write empty or blocks the same as empty fn bodies, empty structs, etc (#9136) 2021-03-06 21:04:51 +02:00
Bartimus
ce92bf8da0
os.File: add .read_struct_at and .write_struct_at (#9114) 2021-03-06 20:44:53 +02:00
Delyan Angelov
5e0e44eb69
os: move file methods to vlib/os/file.c.v, document them, add new file.read_struct and file.write_struct and tests 2021-03-04 14:54:39 +02:00