mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-20 04:19:04 +00:00
os, syscall: implement Stat and Lstat
File.Stat is left as a stub for now. Tests are a bit stubbed down because os.ReadDir, os.Symlink, and t.TempDir are not yet (fully) implemented. TODO: reimport tests from upstream as those materialize.
This commit is contained in:
@@ -56,3 +56,21 @@ func tempDir() string {
|
||||
func (f unixFileHandle) ReadAt(b []byte, offset int64) (n int, err error) {
|
||||
return -1, ErrNotImplemented
|
||||
}
|
||||
|
||||
// isWindowsNulName reports whether name is os.DevNull ('NUL') on Windows.
|
||||
// True is returned if name is 'NUL' whatever the case.
|
||||
func isWindowsNulName(name string) bool {
|
||||
if len(name) != 3 {
|
||||
return false
|
||||
}
|
||||
if name[0] != 'n' && name[0] != 'N' {
|
||||
return false
|
||||
}
|
||||
if name[1] != 'u' && name[1] != 'U' {
|
||||
return false
|
||||
}
|
||||
if name[2] != 'l' && name[2] != 'L' {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user