os: implement virtual filesystem support

This allows applications to mount filesystems in the os package. This is
useful for mounting external flash filesystems, for example.
This commit is contained in:
Ayke van Laethem
2020-03-30 20:52:52 +02:00
committed by Ron Evans
parent e907db1481
commit 6bcb40fe01
8 changed files with 336 additions and 95 deletions
+3 -3
View File
@@ -9,9 +9,9 @@ import (
func main() {
// package os, fmt
fmt.Println("stdin: ", os.Stdin.Fd())
fmt.Println("stdout:", os.Stdout.Fd())
fmt.Println("stderr:", os.Stderr.Fd())
fmt.Println("stdin: ", os.Stdin.Name())
fmt.Println("stdout:", os.Stdout.Name())
fmt.Println("stderr:", os.Stderr.Name())
// package math/rand
fmt.Println("pseudorandom number:", rand.Int31())
+3 -3
View File
@@ -1,6 +1,6 @@
stdin: 0
stdout: 1
stderr: 2
stdin: /dev/stdin
stdout: /dev/stdout
stderr: /dev/stderr
pseudorandom number: 1298498081
strings.IndexByte: 2
strings.Replace: An-example-string