Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirsIdentical ¶
DirsIdentical compares two directories to determine if they are identical It returns true if both directories contain the same files with identical content, and false otherwise
func FilesIdentical ¶
FilesIdentical compares two files byte by byte to determine if they are identical
func FindFiles ¶
FindFiles searches for files with the specified extension in the given root directory and returns a slice of matching file paths.
func FormatFileSize ¶
FormatFileSize formats a file size given in bytes into a human-readable string with appropriate units (B, KB, MB, GB, TB).
func GetDirectorySize ¶
GetDirectorySize calculates the total size (in bytes) of all files within the specified directory
Types ¶
type FileMetadata ¶
type FileMetadata struct {
Name string `json:"name"`
Size int64 `json:"size"`
IsDir bool `json:"is_dir"`
ModTime time.Time `json:"mod_time"`
Mode os.FileMode `json:"mode"`
Path string `json:"path"`
Ext string `json:"ext"`
Owner string `json:"owner"`
}
func GetFileMetadata ¶
func GetFileMetadata(filePath string) (FileMetadata, error)
GetFileMetadata retrieves metadata for the specified file path. It returns a FileMetadata struct containing details about the file.