patch os: File

This commit is contained in:
xushiwei
2024-07-11 14:47:03 +08:00
parent d51a99c8e2
commit dd47971877
14 changed files with 990 additions and 26 deletions

View File

@@ -217,6 +217,7 @@ func setStickyBit(name string) error {
}
return Chmod(name, fi.Mode()|ModeSticky)
}
*/
// Open opens the named file for reading. If successful, methods on
// the returned file can be used for reading; the associated file
@@ -242,7 +243,6 @@ func Create(name string) (*File, error) {
// methods on the returned File can be used for I/O.
// If there is an error, it will be of type *PathError.
func OpenFile(name string, flag int, perm FileMode) (*File, error) {
testlog.Open(name)
f, err := openFileNolog(name, flag, perm)
if err != nil {
return nil, err
@@ -252,6 +252,7 @@ func OpenFile(name string, flag int, perm FileMode) (*File, error) {
return f, nil
}
/*
// lstat is overridden in tests.
var lstat = Lstat