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

vfmt: keep file permissions with -w on !windows (#13334)

This commit is contained in:
Tarcisio Gruppi
2022-02-01 09:49:06 -03:00
committed by GitHub
parent 7c1b249da0
commit 51513ae19a
3 changed files with 43 additions and 0 deletions

View File

@@ -41,3 +41,16 @@ fn test_inode_file_owner_permission() {
assert mode.owner.write
assert !mode.owner.execute
}
fn test_inode_file_permissions_bitmask() {
if user_os() == 'windows' {
println('> skipping ${@FN} on windows')
return
}
filename := './test3.txt'
mut file := open_file(filename, 'w', 0o641) or { return }
file.close()
mode := inode(filename)
rm(filename) or {}
assert mode.bitmask() == 0o641
}