1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Commit Graph

91 Commits

Author SHA1 Message Date
Delyan Angelov
daa9034583
os: return the long path for os.temp_dir() on windows, even for folders like c:\someth~1 (#17623) 2023-03-14 00:51:52 +02:00
paul-elesin
15cb18cbd2
os: make hostname and loginname functions return Result (#17414) 2023-02-27 05:21:23 +03:00
Felipe Pena
82c4338b76
os: move pub fn debugger_present() bool{ to platform-specific files (better ptrace portability handling) (#17373) 2023-02-21 10:55:03 +02:00
Felipe Pena
cb976c7e17
os: fix the declaration of C.ptrace (the 4th parameter is a pointer, not an integer) (#17366) 2023-02-20 12:29:49 +02:00
Delyan Angelov
f69b994c73
os: properly document os.uname, for both nix and windows 2023-01-22 13:18:28 +02:00
yuyi
017ace6ea7
vfmt: change all '$expr' to '${expr}' (#16428) 2022-11-15 16:53:13 +03: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
Delyan Angelov
69c9d47a40
pref,os,sokol,cgen: ease compilation of 2048 with -os wasm32_emscripten (#15820) 2022-09-20 00:17:13 +03:00
tr00
3eb6ad7b8c
os: fix type in error message (#15533) 2022-08-26 06:59:52 +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
Wertzui123
587101a1ea
os: fix find_abs_path_of_executable function (on Windows) (#14835) 2022-06-23 03:36:15 +03:00
Daniel Däschle
d679146a80
fmt: remove space in front of ? and ! (#14366) 2022-05-13 06:56:21 +03:00
Larpon
34a252ef84
os: add raw_execute on Windows (#14363) 2022-05-11 16:56:03 +03:00
Alexander Medvednikov
014c3c97f0 all: byte => u8 2022-04-15 14:45:52 +03:00
Delyan Angelov
60e718e7c6 test: save removing the nonexistent binary output for v fmt and v vet tests 2022-04-09 13:04:52 +03:00
Alexander Medvednikov
36ec47cd20 all: replace "NB:" with "Note:" (docs/comments) 2022-03-06 20:01:22 +03: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
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
1aaac13a60
cgen: make os less special, fix an -autofree leak on just import os
* Improve documentation of v.util.Surrounder

* Remove `os` from the list of "no auto free" `builtin` mods

* Fix -autofree freeing of `const x = []string{}`.

* Add a valgrind regression test.

* Implement os.getenv_opt in vlib/os/environment.js.v too.
2021-11-21 21:50:10 +02:00
Delyan Angelov
50a608aab3
os: remove unnecessary heap allocation from os.execute 2021-11-12 11:45:37 +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
b86c79329b
os, builtin: reduce leaks without -autofree 2021-10-29 15:49:30 +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
Delyan Angelov
eed94c727c
os: move C struct declarations in their own _default.c.v files (#12268) 2021-10-22 17:08:08 +03:00
pancake
00d4c7082e
native: add support for print, eprint and eprintln (#11034) 2021-08-03 16:04:31 +03:00
Delyan Angelov
8eb544146e
os: fix building V on Haiku 2021-07-27 20:28:04 +03:00
Bastian Buck
8f3646cb81
os: fix debugger_present for solaris (#10902)
-solaris has no `sys/ptrace.h`, instead `ptrace` is included in  `sys/types.h` and `unistd.h`
2021-07-22 10:44:00 +03:00
Delyan Angelov
d7dcb47db3
os: implement File.seek/2 and File.tell/0 2021-07-22 08:00:21 +03:00
pancake
47bf64473c
vlib: reimplement glob in V for UNIX to not depend on libc (#10707) 2021-07-09 03:27:16 +03:00
Delyan Angelov
7b4c342396
os: disable os.glob() on Android for now (fixes termux compilation) 2021-07-08 00:00:40 +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
97b83a4986
os: add debugger_present() for linux (#10257) 2021-06-29 15:00:48 +03:00
Uwe Krüger
60c880a0cc
vlib: use malloc_noscan() where possible (#10465) 2021-06-15 14:47:11 +03:00
Bastian Buck
d6e462a6ca
os: fix os.is_link and os.symlink on windows, add new functions os.getppid, os.getgid, os.getegid (#10251) 2021-05-29 23:26:13 +03:00
Miccah
12c3f85507
os: add getuid and geteuid (#10002) 2021-05-05 14:20:11 +03:00
Delyan Angelov
b506d8fcc0
os: use C.getlogin for os.loginname, instead of C.getlogin_r (C.getlogin_r absent on Android) 2021-04-24 13:33:34 +03:00
Bastian Buck
9ec91f4d58
os: add new function os.loginname(), improve some error messages (#9794) 2021-04-19 14:57:25 +03:00
Bastian Buck
546dc91967
os: create os.hostname() and os.chown() + os.uname() for windows (#9722) 2021-04-15 01:49:05 +02:00
Delyan Angelov
d8cb24eef0 ci: fix -cflags -Werror jobs 2021-04-05 23:42:26 +03:00
Delyan Angelov
19b915b105 ci: fix windows-tcc job 2021-04-05 23:35:22 +03:00
Delyan Angelov
5c07cbf5d3
ci: fix v -cc clang-11 -cflags -Werror cmd/v 2021-04-05 08:09:04 +03:00
Alexander Medvednikov
57e6138a61 all: remove byteptr and charptr; replace them with &byte and &char 2021-04-04 17:43:32 +03:00
Delyan Angelov
b7c01db1f9
builtin: add .vstring_literal and .vstring_literal_with_len for converting read only strings like os.args 2021-03-23 22:10:28 +02:00
Delyan Angelov
7f91b75cbc
builtin: fix leaks in os.execute() and []string{} == []string{} 2021-03-23 20:36:19 +02:00
zakuro
e3c0f305b2
os: deprecate os.File.write_bytes and add os.File.write_ptr (#9370) 2021-03-20 09:02:28 +02:00
Delyan Angelov
d7049ae2da
os: deprecate os.exec (returning ?os.Result), in favour of os.execute, which returns os.Result (#8974) 2021-03-08 20:52:13 +02:00
Nick Treleaven
4ccf991f61
checker: warn when casting a fixed array (use &arr[0] instead) (#8787) 2021-02-17 20:45:11 +01:00
Nick Treleaven
4a0367a63c
vlib: add [unsafe] tag to more functions: tos, string_from_wide, strings.Builder: write_bytes, free (#8766) 2021-02-15 17:15:52 +02:00