Lines Matching refs:Open
12 os.DirFS(`\`).Open(`/foo/bar`) open the path `\\foo\bar`, which is
328 // Open implements FileSystem using os.Open, opening files for reading rooted
330 func (d Dir) Open(name string) (File, error) {
343 f, err := os.Open(fullName)
405 // os.Open does. DirFS is therefore not a general substitute for a chroot-style security
415 func (dir dirFS) Open(name string) (fs.File, error) {
422 - f, err := Open(string(dir) + "/" + name)
423 + f, err := Open(fullname)
427 @@ -652,16 +655,35 @@ func (dir dirFS) Open(name string) (fs.File, error) {
472 t.Fatalf(`Open testdata\dirfs succeeded`)
475 + // Test that Open does not open Windows device files.
476 + _, err = d.Open(`NUL`)
478 + t.Errorf(`Open NUL succeeded`)
491 + // Test that Open can open a path starting at /.
493 + f, err := d.Open(cwd + "/testdata/dirfs/a")
507 + _, err := d.Open(path)
509 + t.Fatalf(`DirFS("").Open(%q) succeeded`, path)