File(Standardlibrary/IO/File)

The File Type allows for opening files,reading and writing files.

var file = ?File::Open("my.txt");

File Open functions

SignatureDescription
|Open[PathSpan filename] -> OpenedFile ! OpenFileErrorOpens file returns an error or an OpenedFile.
|Open[imut Path& filename] -> OpenedFile ! OpenFileErrorOpens file returns an error or an OpenedFile.
|Open[imut String& filename] -> OpenedFile ! OpenFileErrorOpens file returns an error or an OpenedFile.
|Open[imut StringSpan& filename] -> OpenedFile ! OpenFileErrorOpens file returns an error or an OpenedFile.

File Read String functions

SignatureDescription
|ReadString[imut StringSpan& filename] -> String ! OpenFileErrorTryes to file a as a string or returns an error if there is one.
|ReadString[imut Path& filename] -> String ! OpenFileErrorTryes to read file a as a string or returns an error if there is one.
|ReadString[PathSpan filename filename] -> String ! OpenFileErrorTryes read to file a as a string or returns an error if there is one.
|ReadString[imut String filename] -> String ! OpenFileErrorTryes read to file a as a string or returns an error if there is one.

File Read Bytes functions

SignatureDescription
|ReadBytes[imut StringSpan filename] -> Vector<byte> ! OpenFileErrorTryes to read file a as a Vector of bytes or returns an error if there is one.
|ReadBytes[imut String& filename] -> Vector<byte> ! OpenFileErrorTryes to read file a as a Vector of bytes or returns an error if there is one.
|ReadBytes[imut PathSpan filename] -> Vector<byte> ! OpenFileErrorTryes to read file a as a Vector of bytes or returns an error if there is one.
|ReadBytes[imut Path& filename]& -> Vector<byte> ! OpenFileErrorTryes to file read a as a Vector of bytes or returns an error if there is one.

File Write String functions

SignatureDescription
|Write[imut StringSpan filename,imut StringSpan data] -> Empty ! FileOpenWriteErrorWrites data the a file or returns an error if there is one.
|Write[imut String& filename,imut StringSpan data] -> Empty ! FileOpenWriteErrorWrites data the a file or returns an error if there is one.
|Write[imut PathSpan filename,imut StringSpan data] -> Empty ! FileOpenWriteErrorWrites data the a file or returns an error if there is one.
|Write[imut Path &filename,imut StringSpan data] -> Empty ! FileOpenWriteErrorWrites data the a file or returns an error if there is one.

File Write Bytes functions

SignatureDescription
|Write[imut StringSpan filename,imut Span data] -> Empty ! FileOpenWriteErrorWrites data the a file or returns an error if there is one.
|Write[imut String& filename,imut Span data] -> Empty ! FileOpenWriteErrorWrites data the a file or returns an error if there is one.
|Write[imut PathSpan filename,imut Span data] -> Empty ! FileOpenWriteErrorWrites data the a file or returns an error if there is one.
|Write[imut Path &filename,imut Span data] -> Empty ! FileOpenWriteErrorWrites data the a file or returns an error if there is one.