Fields Summary |
---|
public static final int | APR_FOPEN_READOpen the file for reading |
public static final int | APR_FOPEN_WRITEOpen the file for writing |
public static final int | APR_FOPEN_CREATECreate the file if not there |
public static final int | APR_FOPEN_APPENDAppend to the end of the file |
public static final int | APR_FOPEN_TRUNCATEOpen the file and truncate to 0 length |
public static final int | APR_FOPEN_BINARYOpen the file in binary mode |
public static final int | APR_FOPEN_EXCLOpen should fail if APR_CREATE and file exists. |
public static final int | APR_FOPEN_BUFFEREDOpen the file for buffered I/O |
public static final int | APR_FOPEN_DELONCLOSEDelete the file after close |
public static final int | APR_FOPEN_XTHREADPlatform dependent tag to open the file for
use across multiple threads |
public static final int | APR_FOPEN_SHARELOCKPlatform dependent support for higher level locked read/write
access to support writes across process/machines |
public static final int | APR_FOPEN_NOCLEANUPDo not register a cleanup when the file is opened |
public static final int | APR_FOPEN_SENDFILE_ENABLEDAdvisory flag that this file should support
apr_socket_sendfile operation |
public static final int | APR_FOPEN_LARGEFILEPlatform dependent flag to enable large file support;
Warning : The APR_LARGEFILE flag only has effect on some platforms
where sizeof(apr_off_t) == 4. Where implemented, it allows opening
and writing to a file which exceeds the size which can be
represented by apr_off_t (2 gigabytes). When a file's size does
exceed 2Gb, apr_file_info_get() will fail with an error on the
descriptor, likewise apr_stat()/apr_lstat() will fail on the
filename. apr_dir_read() will fail with APR_INCOMPLETE on a
directory entry for a large file depending on the particular
APR_FINFO_* flags. Generally, it is not recommended to use this
flag. |
public static final int | APR_SETSet the file position |
public static final int | APR_CURCurrent |
public static final int | APR_ENDGo to end of file |
public static final int | APR_FILE_ATTR_READONLYFile is read-only |
public static final int | APR_FILE_ATTR_EXECUTABLEFile is executable |
public static final int | APR_FILE_ATTR_HIDDENFile is hidden |
public static final int | APR_FLOCK_SHAREDShared lock. More than one process or thread can hold a shared lock
at any given time. Essentially, this is a "read lock", preventing
writers from establishing an exclusive lock. |
public static final int | APR_FLOCK_EXCLUSIVEExclusive lock. Only one process may hold an exclusive lock at any
given time. This is analogous to a "write lock". |
public static final int | APR_FLOCK_TYPEMASKmask to extract lock type |
public static final int | APR_FLOCK_NONBLOCKdo not block while acquiring the file lock |
public static final int | APR_NOFILEno file type determined |
public static final int | APR_REGa regular file |
public static final int | APR_DIRa directory |
public static final int | APR_CHRa character device |
public static final int | APR_BLKa block device |
public static final int | APR_PIPEa FIFO / pipe |
public static final int | APR_LNKa symbolic link |
public static final int | APR_SOCKa [unix domain] socket |
public static final int | APR_UNKFILEa file of some other unknown type |
public static final int | APR_FPROT_USETID |
public static final int | APR_FPROT_UREADSet user id |
public static final int | APR_FPROT_UWRITERead by user |
public static final int | APR_FPROT_UEXECUTEWrite by user |
public static final int | APR_FPROT_GSETIDExecute by user |
public static final int | APR_FPROT_GREADSet group id |
public static final int | APR_FPROT_GWRITERead by group |
public static final int | APR_FPROT_GEXECUTEWrite by group |
public static final int | APR_FPROT_WSTICKYExecute by group |
public static final int | APR_FPROT_WREADSticky bit |
public static final int | APR_FPROT_WWRITERead by others |
public static final int | APR_FPROT_WEXECUTEWrite by others |
public static final int | APR_FPROT_OS_DEFAULTExecute by others |
public static final int | APR_FINFO_LINKuse OS's default permissions |
public static final int | APR_FINFO_MTIMEStat the link not the file itself if it is a link |
public static final int | APR_FINFO_CTIMEModification Time |
public static final int | APR_FINFO_ATIMECreation or inode-changed time |
public static final int | APR_FINFO_SIZEAccess Time |
public static final int | APR_FINFO_CSIZESize of the file |
public static final int | APR_FINFO_DEVStorage size consumed by the file |
public static final int | APR_FINFO_INODEDevice |
public static final int | APR_FINFO_NLINKInode |
public static final int | APR_FINFO_TYPENumber of links |
public static final int | APR_FINFO_USERType |
public static final int | APR_FINFO_GROUPUser |
public static final int | APR_FINFO_UPROTGroup |
public static final int | APR_FINFO_GPROTUser protection bits |
public static final int | APR_FINFO_WPROTGroup protection bits |
public static final int | APR_FINFO_ICASEWorld protection bits |
public static final int | APR_FINFO_NAMEif dev is case insensitive |
public static final int | APR_FINFO_MIN->name in proper case |
public static final int | APR_FINFO_IDENTtype, mtime, ctime, atime, size |
public static final int | APR_FINFO_OWNERdev and inode |
public static final int | APR_FINFO_PROTuser and group |
public static final int | APR_FINFO_NORMall protections |
public static final int | APR_FINFO_DIRENTan atomic unix apr_stat() |
Methods Summary |
---|
public static native int | append(java.lang.String fromPath, java.lang.String toPath, int perms, long pool)Append the specified file to another file.
The new file does not need to exist, it will be created if required.
|
public static native int | attrsSet(java.lang.String fname, int attributes, int mask, long pool)Set attributes of the specified file.
This function should be used in preference to explict manipulation
of the file permissions, because the operations to provide these
attributes are platform specific and may involve more than simply
setting permission bits.
Warning : Platforms which do not implement this feature will return
APR_ENOTIMPL.
|
public static native int | close(long file)Close the specified file.
|
public static native int | copy(java.lang.String fromPath, java.lang.String toPath, int perms, long pool)Copy the specified file to another file.
The new file does not need to exist, it will be created if required.
Warning : If the new file already exists, its contents will be overwritten.
|
public static native long | dup(long newFile, long oldFile, long pool)Duplicate the specified file descriptor.
|
public static native int | dup2(long newFile, long oldFile, long pool)Duplicate the specified file descriptor and close the original.
|
public static native int | eof(long fptr)Are we at the end of the file
|
public static native int | flagsGet(long file)Retrieve the flags that were passed into apr_file_open()
when the file was opened.
|
public static native int | flush(long thefile)Flush the file's buffer.
|
public static native int | getc(long thefile)Read a character from the specified file.
|
public static native int | gets(byte[] buf, int offset, long thefile)Read a string from the specified file.
The buffer will be NUL-terminated if any characters are stored.
|
public static native int | infoGet(FileInfo finfo, int wanted, long thefile)Get the specified file's stats.
|
public static native int | lock(long thefile, int type)Establish a lock on the specified, open file. The lock may be advisory
or mandatory, at the discretion of the platform. The lock applies to
the file as a whole, rather than a specific range. Locks are established
on a per-thread/process basis; a second lock by the same thread will not
block.
|
public static native long | mktemp(java.lang.String templ, int flags, long pool)Open a temporary file
|
public static native int | mtimeSet(java.lang.String fname, long mtime, long pool)Set the mtime of the specified file.
Warning : Platforms which do not implement this feature will return
APR_ENOTIMPL.
|
public static native java.lang.String | nameGet(long thefile)return the file name of the current file.
|
public static native long | open(java.lang.String fname, int flag, int perm, long pool)Open the specified file.
|
public static native int | permsSet(java.lang.String fname, int perms)Set the specified file's permission bits.
Warning : Some platforms may not be able to apply all of the
available permission bits; APR_INCOMPLETE will be returned if some
permissions are specified which could not be set.
Warning : Platforms which do not implement this feature will return
APR_ENOTIMPL.
|
public static native int | pipeCreate(long[] io, long pool)Create an anonymous pipe.
|
public static native long | pipeTimeoutGet(long thepipe)Get the timeout value for a pipe or manipulate the blocking state.
|
public static native int | pipeTimeoutSet(long thepipe, long timeout)Set the timeout value for a pipe or manipulate the blocking state.
|
public static native int | putc(byte ch, long thefile)Write a character into the specified file.
|
public static native int | puts(byte[] str, long thefile)Write the string into the specified file.
|
public static native int | read(long thefile, byte[] buf, int offset, int nbytes)Read data from the specified file.
apr_file_read will read up to the specified number of
bytes, but never more. If there isn't enough data to fill that
number of bytes, all of the available data is read. The third
argument is modified to reflect the number of bytes read. If a
char was put back into the stream via ungetc, it will be the first
character returned.
It is not possible for both bytes to be read and an APR_EOF
or other error to be returned. APR_EINTR is never returned.
|
public static native int | readFull(long thefile, byte[] buf, int offset, int nbytes)Read data from the specified file, ensuring that the buffer is filled
before returning.
Read will read up to the specified number of
bytes, but never more. If there isn't enough data to fill that
number of bytes, then the process/thread will block until it is
available or EOF is reached. If a char was put back into the
stream via ungetc, it will be the first character returned.
It is possible for both bytes to be read and an error to be
returned. And if *bytes_read is less than nbytes, an accompanying
error is _always_ returned.
APR_EINTR is never returned.
|
public static native int | readFullb(long thefile, java.nio.ByteBuffer buf, int offset, int nbytes)Read data from the specified file, ensuring that the buffer is filled
before returning.
Read will read up to the specified number of
bytes, but never more. If there isn't enough data to fill that
number of bytes, then the process/thread will block until it is
available or EOF is reached. If a char was put back into the
stream via ungetc, it will be the first character returned.
It is possible for both bytes to be read and an error to be
returned. And if *bytes_read is less than nbytes, an accompanying
error is _always_ returned.
APR_EINTR is never returned.
|
public static native int | readb(long thefile, java.nio.ByteBuffer buf, int offset, int nbytes)Read data from the specified file.
apr_file_read will read up to the specified number of
bytes, but never more. If there isn't enough data to fill that
number of bytes, all of the available data is read. The third
argument is modified to reflect the number of bytes read. If a
char was put back into the stream via ungetc, it will be the first
character returned.
It is not possible for both bytes to be read and an APR_EOF
or other error to be returned. APR_EINTR is never returned.
|
public static native int | remove(java.lang.String path, long pool)Delete the specified file.
|
public static native int | rename(java.lang.String fromPath, java.lang.String toPath, long pool)Rename the specified file.
Warning : If a file exists at the new location, then it will be
overwritten. Moving files or directories across devices may not be
possible.
|
public static native long | seek(long thefile, int where, long offset)Move the read/write file offset to a specified byte within a file.
|
public static native int | stat(FileInfo finfo, java.lang.String fname, int wanted, long pool)Get the specified file's stats. The file is specified by filename,
instead of using a pre-opened file.
|
public static native int | trunc(long fp, long offset)Truncate the file's length to the specified offset
|
public static native int | ungetc(byte ch, long thefile)Put a character back onto a specified stream.
|
public static native int | unlock(long thefile)Remove any outstanding locks on the file.
|
public static native int | write(long thefile, byte[] buf, int offset, int nbytes)Write data to the specified file.
Write will write up to the specified number of
bytes, but never more. If the OS cannot write that many bytes, it
will write as many as it can. The third argument is modified to
reflect the * number of bytes written.
It is possible for both bytes to be written and an error to
be returned. APR_EINTR is never returned.
|
public static native int | writeFull(long thefile, byte[] buf, int offset, int nbytes)Write data to the specified file, ensuring that all of the data is
written before returning.
Write will write up to the specified number of
bytes, but never more. If the OS cannot write that many bytes, the
process/thread will block until they can be written. Exceptional
error such as "out of space" or "pipe closed" will terminate with
an error.
It is possible for both bytes to be written and an error to
be returned. And if *bytes_written is less than nbytes, an
accompanying error is _always_ returned.
APR_EINTR is never returned.
|
public static native int | writeFullb(long thefile, java.nio.ByteBuffer buf, int offset, int nbytes)Write data to the specified file, ensuring that all of the data is
written before returning.
Write will write up to the specified number of
bytes, but never more. If the OS cannot write that many bytes, the
process/thread will block until they can be written. Exceptional
error such as "out of space" or "pipe closed" will terminate with
an error.
It is possible for both bytes to be written and an error to
be returned. And if *bytes_written is less than nbytes, an
accompanying error is _always_ returned.
APR_EINTR is never returned.
|
public static native int | writeb(long thefile, java.nio.ByteBuffer buf, int offset, int nbytes)Write data to the specified file.
Write will write up to the specified number of
bytes, but never more. If the OS cannot write that many bytes, it
will write as many as it can. The third argument is modified to
reflect the * number of bytes written.
It is possible for both bytes to be written and an error to
be returned. APR_EINTR is never returned.
|
public static native int | writev(long thefile, byte[][] vec)Write data from aray of byte arrays to the specified file.
It is possible for both bytes to be written and an error to
be returned. APR_EINTR is never returned.
apr_file_writev is available even if the underlying
operating system doesn't provide writev().
|
public static native int | writevFull(long thefile, byte[][] vec)Write data from aray of byte arrays to the specified file,
ensuring that all of the data is written before returning.
writevFull is available even if the underlying
operating system doesn't provide writev().
|