BufferedFiles Documentation
BufferedFiles
BufferedFiles.BufferedFiles
— ModuleBufferedFiles
Implementations of a better Filehandles.
Includes a Read-Only Filehandle, a better Write-Only Filehandle as well as Mmap-Filehandles (currently only on Unix) allowing both Reading and writing (but not appending (yet)).
Main Functions: bufferedopen
and @om_str
BufferedFiles.DEFAULT_BUFSIZE
— Constantconst DEFAULT_BUFSIZE = 16 * (1024) * (1024)
Default size of the read/write-buffer of BufferedReadFile
and BufferedWriteFile
.
BufferedFiles.BufferedFile
— Typeabstract type BufferedFile <: IO end
Abstract Type for my Filehandles, to overwrite some of Julias functions from io.jl that cause allocations.
BufferedFiles.BufferedOpenMode
— Typeabstract type BufferedOpenMode end
Types Implemented by @om_str
, used in bufferedopen
BufferedFiles.BufferedOpenMode
— MethodBufferedOpenMode(pattern::AbstractString)
Convert pattern
into its corresponding subtype of BufferedOpenMode
.
Recommended Usage of this is with the @om_str
macro at parse-time.
BufferedFiles.BufferedReadFile
— TypeBufferedReadFile
Buffered Filehandle for more performant Reading.
Opened via bufferedopen(filename, om"r")
.
BufferedFiles.BufferedWriteFile
— TypeBufferedReadFile
Buffered Filehandle for more performant Reading.
Opened via bufferedopen(filename, om"r")
.
BufferedFiles.RawFile
— Typestruct RawFile <: BufferedFile
fd::Cint
end
Raw Filehandle with no Buffer, that calls the C-Functions for Reading, Writing etc.
Used in BufferedReadFile
and BufferedWriteFile
.
BufferedFiles.bufferedopen
— Functionbufferedopen(file::AbstractString, om"r"[, bufsize::Integer])
Open a File in Read-Only Mode.
Returns a BufferedReadFile
.
BufferedFiles.bufferedopen
— Functionbufferedopen(file::AbstractString, om"w"[, bufsize::Integer])
Open a File in Write-Only Mode.
Truncates the File when opening it.
Returns a BufferedWriteFile
.
BufferedFiles.bufferedopen
— Methodbufferedopen(file::AbstractString, openmode::AbstractString, args...)
Open a File.
Which type of Filehandle is returned depends on openmode.
BufferedFiles.bufferedopen
— Methodbufferedopen(file::AbstractString, om"mr+", fs::Integer)
Open a file via Mmap in Read-Write Mode.
The file will be truncated to fs
Byte before opening it via Mmap.
Appending is currently not possible and will throw an EOFError
.
BufferedFiles.bufferedopen
— Methodbufferedopen(file::AbstractString, om"mr+")
Open a file via Mmap in Read-Write Mode.
Appending is currently not possible and will throw an EOFError
.
BufferedFiles.bufferedopen
— Methodbufferedopen(file::AbstractString, om"mr")
Open a file via Mmap in Read-Only Mode.
BufferedFiles.@om_str
— Macro@om_str "pattern"
om"pattern"
Convert pattern
into its corresponding subtype of BufferedOpenMode
at parse-time.
Libc
BufferedFiles.Libc
— ModuleLibc
Interface for all the C-Calls and Constants used.
If a C-Function returns an error-code, Base.systemerror
is used to confirm the return code, so the User does not need to do any error-checking themselfs.