--------------------------------------------------------------------------- File size probe --------------------------------------------------------------------------- FileSizeProbeCommand returns a shell command that outputs the file size in bytes.
(filePath string)
| 254 | |
| 255 | // FileSizeProbeCommand returns a shell command that outputs the file size in bytes. |
| 256 | func FileSizeProbeCommand(filePath string) string { |
| 257 | return fmt.Sprintf("stat -c%%s '%s' 2>/dev/null || wc -c < '%s'", filePath, filePath) |
| 258 | } |
| 259 | |
| 260 | // ParseFileSizeOutput extracts a file size integer from probe command output. |
| 261 | // It strips shell metadata (exit codes, whitespace) and parses the first integer found. |
no outgoing calls