Skip to content

Commit

Permalink
vfs: add a newly created file straight into the directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ncw committed Nov 11, 2019
1 parent 1e423d2 commit 6150ae8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vfs/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,10 @@ func (f *File) Open(flags int) (fd Handle, err error) {
fs.Errorf(f, "Can't figure out how to open with flags: 0x%X", flags)
return nil, EPERM
}
// if creating a file, add the file to the directory
if err == nil && flags&os.O_CREATE != 0 {
f.d.addObject(f)
}
return fd, err
}

Expand Down

0 comments on commit 6150ae8

Please sign in to comment.