Documentation
¶
Overview ¶
Package apputil provides utility functions for file and directory operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDir ¶
EnsureDir checks if a file could be written to a path and creates the necessary directories if they don't exist. It ensures that all parent directories in the path are created with the appropriate permissions.
Parameters ¶
- fileName: The full path to the file for which directories need to be created.
Expected behavior:
Extracts the directory path from the fileName.
Checks if the directory exists.
If the directory doesn't exist, creates it and all parent directories.
func FileExists ¶
FileExists reports whether the named file or directory exists.
Parameters ¶
- filePath: The full path to the file or directory to check.
Returns:
- bool: true if the file or directory exists, false otherwise.
Behavior:
Uses os.Stat to check if the file or directory exists.
Returns true if the file exists and can be accessed.
Returns false if the file doesn't exist or cannot be accessed due to permissions.
Types ¶
This section is empty.
Source Files
¶
- apputil.go