package file
import "github.com/influxdata/influxdb/pkg/file"
Index ¶
- func MoveFileWithReplacement(src, dst string) error
- func RenameFile(oldpath, newpath string) error
- func RenameFileWithReplacement(oldpath, newpath string) error
- func SyncDir(dirName string) error
Functions ¶
func MoveFileWithReplacement ¶
MoveFileWithReplacement copies the file contents at `src` to `dst`. and deletes `src` on success.
If the file at `dst` already exists, it will be truncated and its contents overwritten.
func RenameFile ¶
RenameFile renames oldpath to newpath, returning an error if newpath already exists. If this function returns successfully, the contents of newpath will be identical to oldpath, and oldpath will be removed.
func RenameFileWithReplacement ¶
RenameFileWithReplacement will replace any existing file at newpath with the contents of oldpath. It works also if it the rename spans over several file systems.
If no file already exists at newpath, newpath will be created using the contents of oldpath. If this function returns successfully, the contents of newpath will be identical to oldpath, and oldpath will be removed.
func SyncDir ¶
Source Files ¶
- Version
- v1.12.0 (latest)
- Published
- Apr 8, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 2 days ago –
Tools for package owners.