Package net.rubygrapefruit.platform
Interface PosixFiles
- All Superinterfaces:
Files
,NativeIntegration
- All Known Implementing Classes:
DefaultPosixFiles
Functions to query and modify files on a Posix file system.
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the mode for the given file.Reads the contents of a symbolic link.void
Sets the mode for the given file.Returns basic information about the given file.Returns basic information about the given file.void
Creates a symbolic link with given contents.
-
Method Details
-
setMode
Sets the mode for the given file.- Throws:
NativeException
- On failure.
-
getMode
Gets the mode for the given file.- Throws:
NativeException
- On failure.
-
symlink
Creates a symbolic link with given contents.- Throws:
NativeException
- On failure.
-
readLink
Reads the contents of a symbolic link.- Throws:
NativeException
- On failure.
-
stat
Returns basic information about the given file. Returns whatever file details can be efficiently calculated in a single system call, which is more efficient that querying these details separately.When the file references a symlink, details about the symlink is returned, not the target of the symlink.
- Specified by:
stat
in interfaceFiles
- Parameters:
path
- The path of the file to get details of. Follows symlinks to the parent directory of this file.- Returns:
- Details of the file. Returns details with type
FileInfo.Type.Missing
for a file that does not exist. - Throws:
NativeException
- On failure to query the file information.
-
stat
Returns basic information about the given file. Returns whatever file details can be efficiently calculated in a single system call, which is more efficient that querying these details separately.- Specified by:
stat
in interfaceFiles
- Parameters:
file
- The path of the file to get details of. Follows symlinks to the parent directory of this file.linkTarget
- When true and the file is a symlink, return details of the target of the symlink instead of details of the symlink itself.- Returns:
- Details of the file. Returns details with type
FileInfo.Type.Missing
for a file that does not exist. - Throws:
NativeException
- On failure to query the file information.
-