File IO
Files are used to pass data to and from the PORTA binaries. The vertex representation is written to files with the .poi
extension while the halfspace representation is written to files with the .ieq
extension
For more details regarding the .poi
and .ieq
file formats, please refer to the PORTA General File Format docs.
Reading & Writing PORTA Files
XPORTA.read_poi
— Functionread_poi( filepath::String ) :: POI{Rational{Int}}
Constructs a POI
struct by parsing the provided .poi
file. A DomainError
is thrown if argument filepath
does not end with the .poi
extension.
XPORTA.read_ieq
— Functionread_ieq( filepath::String ) :: IEQ{Rational{Int}}
Constructs an IEQ
struct by parsing the provided .ieq
file. A DomainError
is thrown if argument filepath
does not end with the .ieq
extension.
XPORTA.write_poi
— Functionwrite_poi(filename::String, poi::POI; dir::String="./") :: String
Writes a .poi
file, dir/filename.poi
, from the provided POI
. If filename
does not explicitly have the .poi
extension, it will automatically be added. The method returns the complete file path for the created file, dir/filename.poi
.
XPORTA.write_ieq
— Functionwrite_ieq( filename::String, ieq::IEQ; dir::String="./") :: String
Writes an .ieq
file, dir/filename.ieq
, from the provided IEQ
struct. If filename
does not explicitly contain the .ieq
extension, it will be added automatically. The method returns the complete file path for the created file, dir/filename.ieq
.
Temp Files (Default Usage)
By default, XPORTA.jl will create the porta_tmp/
directory to which it will write all PORTA related files. At the end of computation, porta_tmp/
and all of its contents are deleted.
This functionality can be overridden by passing cleanup = false
to the appropriate methods, e.g. traf
.
XPORTA.make_porta_tmp
— Functionmake_porta_tmp( dir::String = "./") :: String
Creates the porta_tmp/
directory in directory dir
and returns the porta_tmp
path.
XPORTA.rm_porta_tmp
— Functionrm_porta_tmp( dir::String = "./")
Recursively removes porta_tmp/
from directory dir
.
This method uses rm("<dir/>porta_tmp/", force=true, recursive=true)
. Make sure not to delete important data.