mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
windows: "".to_wide() fixes
This commit is contained in:
@@ -131,8 +131,9 @@ pub fn is_dir(path string) bool {
|
||||
*/
|
||||
|
||||
pub fn open(path string) ?File {
|
||||
mode := 'rb'
|
||||
file := File {
|
||||
cfile: C._wfopen(path.to_wide(), 'rb'.to_wide())
|
||||
cfile: C._wfopen(path.to_wide(), mode.to_wide())
|
||||
opened: true
|
||||
}
|
||||
if isnil(file.cfile) {
|
||||
@@ -143,8 +144,9 @@ pub fn open(path string) ?File {
|
||||
|
||||
// create creates a file at a specified location and returns a writable `File` object.
|
||||
pub fn create(path string) ?File {
|
||||
mode := 'wb'
|
||||
file := File {
|
||||
cfile: C._wfopen(path.to_wide(), 'wb'.to_wide())
|
||||
cfile: C._wfopen(path.to_wide(), mode.to_wide())
|
||||
opened: true
|
||||
}
|
||||
if isnil(file.cfile) {
|
||||
|
Reference in New Issue
Block a user