public interface IWritableMount extends IMount
IComputerAccess.mount(String, IMount)
or IComputerAccess.mountWritable(String, IWritableMount)
, that can also be written to.
Ready made implementations of this interface can be created using
ComputerCraftAPI.createSaveDirMount(World, String, long)
, or you're free to implement it yourselves!Modifier and Type | Method and Description |
---|---|
void |
delete(java.lang.String path)
Deletes a directory at a given path inside the virtual file system.
|
long |
getRemainingSpace()
Get the amount of free space on the mount, in bytes.
|
void |
makeDirectory(java.lang.String path)
Creates a directory at a given path inside the virtual file system.
|
java.io.OutputStream |
openForAppend(java.lang.String path)
Opens a file with a given path, and returns an
OutputStream for appending to it. |
java.io.OutputStream |
openForWrite(java.lang.String path)
Opens a file with a given path, and returns an
OutputStream for writing to it. |
exists, getSize, isDirectory, list, openForRead
void makeDirectory(java.lang.String path) throws java.io.IOException
path
- A file path in normalised format, relative to the mount location. ie: "programs/mynewprograms".java.io.IOException
- If the directory already exists or could not be created.void delete(java.lang.String path) throws java.io.IOException
path
- A file path in normalised format, relative to the mount location. ie: "programs/myoldprograms".java.io.IOException
- If the file does not exist or could not be deleted.java.io.OutputStream openForWrite(java.lang.String path) throws java.io.IOException
OutputStream
for writing to it.path
- A file path in normalised format, relative to the mount location. ie: "programs/myprogram".java.io.IOException
- If the file could not be opened for writing.java.io.OutputStream openForAppend(java.lang.String path) throws java.io.IOException
OutputStream
for appending to it.path
- A file path in normalised format, relative to the mount location. ie: "programs/myprogram".java.io.IOException
- If the file could not be opened for writing.long getRemainingSpace() throws java.io.IOException
java.io.IOException
- If the remaining space could not be computed.