io/fs
< internal/testlog
< internal/poll
- < internal/safefilepath
+ < internal/filepathlite
< os
< os/signal;
unicode, fmt !< net, os, os/signal;
- os/signal, internal/safefilepath, STR
+ os/signal, internal/filepathlite, STR
< path/filepath
< io/ioutil;
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Package safefilepath manipulates operating-system file paths.
-package safefilepath
+// Package filepathlite manipulates operating-system file paths.
+package filepathlite
import (
"errors"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package safefilepath
+package filepathlite
import "internal/bytealg"
//go:build unix || (js && wasm) || wasip1
-package safefilepath
+package filepathlite
import "internal/bytealg"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package safefilepath
+package filepathlite
import (
"internal/bytealg"
package os
import (
- "internal/safefilepath"
+ "internal/filepathlite"
"io"
"io/fs"
"sort"
return err
}
- fpath, err := safefilepath.Localize(path)
+ fpath, err := filepathlite.Localize(path)
if err != nil {
return err
}
// TODO(panjf2000): handle symlinks with the help of fs.ReadLinkFS
// once https://go.dev/issue/49580 is done.
- // we also need safefilepath.IsLocal from https://go.dev/cl/564295.
+ // we also need filepathlite.IsLocal from https://go.dev/cl/564295.
if !d.Type().IsRegular() {
return &PathError{Op: "CopyFS", Path: path, Err: ErrInvalid}
}
import (
"errors"
+ "internal/filepathlite"
"internal/poll"
- "internal/safefilepath"
"internal/testlog"
"io"
"io/fs"
if dir == "" {
return "", errors.New("os: DirFS with empty root")
}
- name, err := safefilepath.Localize(name)
+ name, err := filepathlite.Localize(name)
if err != nil {
return "", ErrInvalid
}
import (
"errors"
- "internal/safefilepath"
+ "internal/filepathlite"
"io/fs"
"os"
"slices"
//
// The path returned by Localize will always be local, as reported by IsLocal.
func Localize(path string) (string, error) {
- return safefilepath.Localize(path)
+ return filepathlite.Localize(path)
}
// ToSlash returns the result of replacing each separator character
package filepath
import (
- "internal/safefilepath"
+ "internal/filepathlite"
"os"
"strings"
"syscall"
if part == "." || part == ".." {
hasDots = true
}
- if safefilepath.IsReservedName(part) {
+ if filepathlite.IsReservedName(part) {
return false
}
}