paul-elesin
15cb18cbd2
os: make hostname and loginname functions return Result ( #17414 )
2023-02-27 05:21:23 +03:00
Thomas Peißl
3aeb6179b7
os: rework mv so it works with different partitions (add fallback to os.mv_by_cp + tests) ( #17065 )
2023-01-22 19:02:04 +02:00
yuyi
68883fc4d9
os: fix os.file_ext('/tmp/.gitignore')
previously returning '.gitignore' => it now returns '' ( #16771 )
2022-12-26 12:53:38 +02:00
yuyi
f16722596c
all: replace generic '<>' with '[]' in error messages and comments ( #16571 )
2022-12-02 09:22:48 +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
yuyi
017ace6ea7
vfmt: change all '$expr' to '${expr}' ( #16428 )
2022-11-15 16:53:13 +03: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
Delyan Angelov
2083e6b04c
os: cleanup APIs returning !bool
to either return !
or bool
( #16111 )
2022-10-20 13:56:06 +03:00
yuyi
f6844e9766
all: change optional to result of io ( #16075 )
2022-10-16 09:28:57 +03:00
Dominik Pytlewski
721328ef58
os: fix os.read_file and os.read_bytes for 0 sized /proc/ files on Linux ( fix #15852 ) ( #15853 )
2022-09-25 22:54:46 +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
f922ed0941
tests: unify all temporary files/folders under $VTMP/v
, that can be cleaned by v wipe-cache
( #15774 )
2022-09-16 04:56:19 +03:00
Delyan Angelov
728b198384
os: extract dir_expansions_test.v from os_test.v
2022-09-01 13:07:29 +03:00
Reuben Thomas
ed56c3957e
os: add File.reopen and File.eof methods ( #15184 )
2022-07-28 16:21:23 +03:00
Markus F.X.J. Oberhumer
74bb5ae17a
os: add an optional "mode" parameter to os.mkdir and os.mkdir_all ( #14887 )
2022-06-30 13:49:47 +03:00
Ben
e201665e92
os: fix file_ext function ( #14566 )
2022-06-02 07:09:46 +03:00
Ben
cbb24d34c9
os: fix is_abs_path function for Windows systems ( #14397 )
2022-05-16 09:59:37 +03:00
Daniel Däschle
d679146a80
fmt: remove space in front of ? and ! ( #14366 )
2022-05-13 06:56:21 +03:00
Nick Treleaven
d8a5df9044
checker: error if smaller signed == unsigned ( #14078 )
2022-04-25 12:09:25 +03:00
Larpon
506259adb6
os: add behavior info to is_dir_empty
documentation ( #14110 )
2022-04-21 18:21:00 +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
pancake
af79c1e6ef
os: implement os.config_dir() like in Go's UserConfigDir ( #13893 )
2022-04-01 22:04:43 +03:00
Alexander Medvednikov
36ec47cd20
all: replace "NB:" with "Note:" (docs/comments)
2022-03-06 20:01:22 +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
Merlin Diavova
f3683b7cdc
os: add an .exit_code field to os.Command ( #13321 )
...
* Added os.Command.exit_code
* vfmt vlib/os/os_test.v
* extract os.Command to os.v, add a dummy panicing implementation on windows, just for parity, fix os_test.v on macos, skip test_command on windows.
Co-authored-by: Merlin Diavova <md@merlindiaova.org>
Co-authored-by: Delyan Angelov <delian66@gmail.com>
2022-01-30 00:44:52 +02:00
Delyan Angelov
fa6f7d4c83
os: add os.quoted_path/1, use it consistently for running V itself
2022-01-22 21:13:28 +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
Delyan Angelov
50a608aab3
os: remove unnecessary heap allocation from os.execute
2021-11-12 11:45:37 +02:00
Delyan Angelov
c6b8b0bb0a
ci: make test_execute in os_test.v more robust
2021-11-12 11:24:37 +02:00
Delyan Angelov
fcecf527ec
ci: fix failing os_test.v on the CI
2021-11-12 10:27:35 +02:00
Delyan Angelov
20d63de136
os: fix os.execute for command output that contains 0 bytes
2021-11-12 09:39:15 +02:00
Delyan Angelov
bb71089b70
os: make the os_test.v functions more robust on windows (normalise the returned paths before comparing them)
2021-10-24 19:54:00 +03:00
Delyan Angelov
e99b699ac6
os: make os.mkdir_all more robust (honor / on windows too), add a test for it
2021-10-24 19:16:46 +03:00
Delyan Angelov
f34daf9ff4
os: add os.walk_with_context/3 and a test for it
2021-10-24 19:12:14 +03:00
Delyan Angelov
d1c4b470bc
os: make os.ls('') return an error, make os.walk_ext more memory efficient on deep hierarchies, add tests for os.walk_ext
2021-10-24 18:44:13 +03:00
Larpon
bd33eaa3b8
os: add function to expand "~" to home directory ( #11362 )
2021-09-01 16:32:28 +03:00
Alexander Medvednikov
f731060caf
all: update chmod/chdir usages
2021-08-28 10:23:01 +03:00
Alexander Medvednikov
858ba25d55
os: make chdir() return error
2021-08-28 09:35:39 +03:00
Delyan Angelov
efa8dcf4d2
time: turn Time.unix to i64, so it can represent times before 1970-01-01, fix time operators, add more tests ( #11050 )
2021-08-04 13:12:02 +03:00
Delyan Angelov
d82d41d804
os: fix os.dir, os.base, os.file_name, when the argument contains / on windows
2021-07-31 13:52:54 +03:00
Delyan Angelov
44892fd942
os: let os.dir("/xyz")
return "/" (fixes compiling .v files in /)
2021-07-30 03:28:53 +03:00
pancake
fe65cde03b
tools: use os.symlink instead of system('ln -s') in v symlink
( #10769 )
2021-07-12 14:23:25 +03:00
Delyan Angelov
972542d6ee
checker: [noreturn]
part 2 (cleanup) ( #10667 )
2021-07-05 05:05:37 +03:00
Bastian Buck
8cc49b5e9e
os: add utime() ( #9796 )
2021-06-30 10:21:23 +03:00
Bastian Buck
d2f19ac494
os: add a glob() function ( #10497 )
2021-06-30 08:30:18 +03:00
Bastian Buck
1e9e717111
os: fix using Win32-API with TCC32 ( #10496 )
2021-06-21 14:14:58 +03:00
Delyan Angelov
48b3ab831b
ci: fix failing test test_realpath_existing for os.real_path on macos
2021-06-15 14:13:12 +03:00
Delyan Angelov
0c922f5570
ci: fix the failing os.real_path tests on windows
2021-06-15 13:34:28 +03:00