Standard libraryinternal/safefilepath Index | Files

package safefilepath

import "internal/safefilepath"

Package safefilepath manipulates operating-system file paths.

Index

Functions

func FromFS

func FromFS(path string) (string, error)

FromFS converts a slash-separated path into an operating-system path.

FromFS returns an error if the path cannot be represented by the operating system. For example, paths containing '\' and ':' characters are rejected on Windows.

func IsReservedName

func IsReservedName(name string) bool

IsReservedName reports if name is a Windows reserved device name. It does not detect names with an extension, which are also reserved on some Windows versions.

For details, search for PRN in https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file.

Source Files

path.go path_windows.go

Version
v1.22.0
Published
Feb 2, 2024
Platform
windows/amd64
Imports
3 packages
Last checked
6 minutes ago

Tools for package owners.