diff --git a/vlib/os/os.v b/vlib/os/os.v index bfdc2130dc..79f5dde8cc 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -171,7 +171,7 @@ pub fn cp(old, new string) ?bool { if fp_from < 0 { // Check if file opened return error_with_code('cp: failed to open $old', int(fp_from)) } - fp_to := C.open(new.str, C.O_WRONLY | C.O_CREAT | C.O_TRUNC) + fp_to := C.open(new.str, C.O_WRONLY | C.O_CREAT | C.O_TRUNC, C.S_IWUSR | C.S_IRUSR) if fp_to < 0 { // Check if file opened (permissions problems ...) C.close(fp_from) return error_with_code('cp: failed to write to $new', int(fp_to))