Skip to content

Commit

Permalink
Create the file when opening, if necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
skx committed Apr 16, 2024
1 parent a64def2 commit 6109480
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpm/cpm_syscalls.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func SysCallFileOpen(cpm *CPM) error {

// Now we open..
var err error
cpm.file, err = os.OpenFile(fileName, os.O_RDWR, 0644)
cpm.file, err = os.OpenFile(fileName, os.O_CREATE|os.O_RDWR, 0644)
if err != nil {
return err
}
Expand Down Expand Up @@ -375,7 +375,7 @@ func SysCallMakeFile(cpm *CPM) error {
}

// Create the file
file, err := os.OpenFile(fileName, os.O_RDONLY|os.O_CREATE, 0644)
file, err := os.OpenFile(fileName, os.O_RDWR|os.O_CREATE, 0644)
if err != nil {
return err
}
Expand Down

0 comments on commit 6109480

Please sign in to comment.