exfile v0.3.6 Exfile.LocalFile View Source
Represents a file on the local filesystem.
Link to this section Summary
Functions
Copies the LocalFile to a new file-based LocalFile
Opens a LocalFile into an IO pid
Returns the size (in bytes) of the file
Link to this section Types
Link to this type
t()
View Source
t() :: %Exfile.LocalFile{io: :file.io_device, meta: map, path: String.t}
Link to this section Functions
Copies the LocalFile to a new file-based LocalFile.
Once the calling pid dies, the file will be automatically removed from the filesystem (see Exfile.Tempfile for more details).
Link to this function
open(local_file)
View Source
open(t) :: {:ok, :file.io_device} | {:error, :file.posix} | no_return
Opens a LocalFile into an IO pid.
If the LocalFile is already IO-based, the IO will be rewound to the beginning of the file.
Link to this function
size(local_file)
View Source
size(t) :: {:ok, integer} | {:error, :file.posix}
Returns the size (in bytes) of the file.