MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / FileSizeProbeCommand

Function FileSizeProbeCommand

internal/sessions/transfer.go:256–258  ·  view source on GitHub ↗

--------------------------------------------------------------------------- File size probe --------------------------------------------------------------------------- FileSizeProbeCommand returns a shell command that outputs the file size in bytes.

(filePath string)

Source from the content-addressed store, hash-verified

254
255// FileSizeProbeCommand returns a shell command that outputs the file size in bytes.
256func 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.

Callers 2

probeAndDownloadMethod · 0.92
TestFileSizeProbeCommandFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFileSizeProbeCommandFunction · 0.68