FileUtils
class FileUtils
Helper class for reading/writing streams and files via chunks
Methods
Reads from the given stream (since fread may only return 8K)
Writes data to the given stream
Performs a chunked File read, echoing output and counting bandwidth
Perform a chunked write to a file
Returns the chunk size to use for reading/writing a file
Peform a chunked file read to stdout
Perform a chunked write to a file
Details
at line 21
static string
ReadStream(resource $stream, int $bytes, bool $strict = true)
Reads from the given stream (since fread may only return 8K)
at line 54
static void
WriteStream(resource $stream, string $data)
Writes data to the given stream
at line 87
static void
DoChunkedRead(File $file, int $fstart, int $flast, int $chunksize, bool $align, bool $debugdl = false)
Performs a chunked File read, echoing output and counting bandwidth
at line 120
static int
DoChunkedWrite(resource $handle, File $file, int $wstart, int $chunksize, bool $align)
Perform a chunked write to a file
at line 147
static int
GetChunkSize(int $chunksize, int|null $fschunksize = null)
Returns the chunk size to use for reading/writing a file
Based on the configured RW chunk size and the file's FS chunk size We want to use the RW size but MUST use a multiple of the FS size
at line 164
static void
ChunkedRead(ObjectDatabase $database, File $file, int $fstart, int $flast, bool $debugdl = false)
Peform a chunked file read to stdout
at line 182
static int
ChunkedWrite(ObjectDatabase $database, resource $handle, File $file, int $wstart)
Perform a chunked write to a file