|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.quercus.module.AbstractQuercusModule
com.caucho.quercus.lib.file.FileModule
public class FileModule
Information and actions for about files
| Field Summary | |
|---|---|
static java.lang.String |
DIRECTORY_SEPARATOR
|
static int |
FILE_APPEND
|
static int |
FILE_IGNORE_NEW_LINES
|
static int |
FILE_SKIP_EMPTY_LINES
|
static int |
FILE_USE_INCLUDE_PATH
|
static int |
FNM_CASEFOLD
|
static int |
FNM_NOESCAPE
|
static int |
FNM_PATHNAME
|
static int |
FNM_PERIOD
|
static int |
GLOB_BRACE
|
static int |
GLOB_ERR
|
static int |
GLOB_MARK
|
static int |
GLOB_NOCHECK
|
static int |
GLOB_NOESCAPE
|
static int |
GLOB_NOSORT
|
static int |
GLOB_ONLYDIR
|
static int |
LOCK_EX
|
static int |
LOCK_NB
|
static int |
LOCK_SH
|
static int |
LOCK_UN
|
static java.lang.String |
PATH_SEPARATOR
|
static int |
PATHINFO_BASENAME
|
static int |
PATHINFO_DIRNAME
|
static int |
PATHINFO_EXTENSION
|
static int |
PATHINFO_FILENAME
|
static int |
SEEK_CUR
|
static int |
SEEK_END
|
static int |
SEEK_SET
|
static int |
UPLOAD_ERR_CANT_WRITE
|
static int |
UPLOAD_ERR_EXTENSION
|
static int |
UPLOAD_ERR_FORM_SIZE
|
static int |
UPLOAD_ERR_INI_SIZE
|
static int |
UPLOAD_ERR_NO_FILE
|
static int |
UPLOAD_ERR_NO_TMP_DIR
|
static int |
UPLOAD_ERR_OK
|
static int |
UPLOAD_ERR_PARTIAL
|
| Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule |
|---|
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER |
| Constructor Summary | |
|---|---|
FileModule()
|
|
| Method Summary | |
|---|---|
static Value |
basename(StringValue path,
StringValue suffix)
Returns the base name of a string. |
static boolean |
chdir(Env env,
Path path)
Changes the working directory |
static boolean |
chgrp(Env env,
Path file,
Value group)
Changes the group of the file. |
static boolean |
chmod(Env env,
Path file,
int mode)
Changes the permissions of the file. |
static boolean |
chown(Env env,
Path file,
Value user)
Changes the ownership of the file. |
static boolean |
chroot(Env env,
Path path)
Changes the working directory, forming a virtual root |
static Value |
clearstatcache(Env env)
Clears the stat cache for the file |
static Value |
closedir(Env env,
DirectoryValue dirV)
Closes the directory |
static boolean |
copy(Env env,
Path src,
Path dst)
Copies a file to the destination. |
static Directory |
dir(Env env,
Path path)
Opens a directory |
StringValue |
dirname(Env env,
StringValue path)
Returns the directory name of a string. |
static Value |
disk_free_space(Env env,
Path directory)
Returns the free space for disk partition containing the directory |
static Value |
disk_total_space(Env env,
Path directory)
Returns the total space for disk partition containing the directory |
static Value |
diskfreespace(Env env,
Path directory)
Returns the total space for disk partition containing the directory |
static boolean |
fclose(Env env,
BinaryStream s)
Closes a file. |
static boolean |
feof(Env env,
BinaryStream binaryStream)
Checks for the end of file. |
static boolean |
fflush(Env env,
BinaryOutput os)
Flushes a file. |
static Value |
fgetc(Env env,
BinaryInput is)
Returns the next character as a byte |
Value |
fgetcsv(Env env,
BinaryInput is,
int length,
java.lang.String delimiter,
java.lang.String enclosure)
Parses a comma-separated-value line from a file. |
static Value |
fgets(Env env,
BinaryInput is,
int length)
Returns the next line |
static Value |
fgetss(Env env,
BinaryInput is,
int length,
Value allowedTags)
Returns the next line stripping tags |
static boolean |
file_exists(Path path)
Returns true if file exists |
static StringValue |
file_get_contents(Env env,
StringValue filename,
boolean useIncludePath,
Value context,
long offset,
long maxLen)
Parses the file, returning it as a string array. |
static Value |
file_put_contents(Env env,
StringValue filename,
Value data,
int flags,
Value context)
Writes data to a file. |
static Value |
file(Env env,
StringValue filename,
int flags,
Value context)
Parses the file, returning it in an array. |
static Value |
fileatime(Env env,
Path path)
Returns the file access time |
static Value |
filectime(Env env,
Path path)
Returns the file create time |
static Value |
filegroup(Env env,
Path path)
Returns the file's group |
static Value |
fileinode(Env env,
Path path)
Returns the file's inocde |
static Value |
filemtime(Env env,
Path path)
Returns the file modified time |
static Value |
fileowner(Env env,
Path path)
Returns the file's owner |
static Value |
fileperms(Env env,
Path path)
Returns the file's permissions |
static Value |
filesize(Env env,
Path path)
Returns the file's size |
static Value |
filetype(Env env,
Path path)
Returns the file's type |
static boolean |
flock(Env env,
LockableStream fileV,
int operation,
Value wouldBlock)
Advisory locking |
static boolean |
fnmatch(Env env,
java.lang.String pattern,
java.lang.String string,
int flags)
Returns true if the given string matches the given glob pattern. |
static BinaryStream |
fopen(Env env,
StringValue filename,
java.lang.String mode,
boolean useIncludePath,
Value contextV)
Opens a file. |
Value |
fpassthru(Env env,
BinaryInput is)
Output the filepointer data to the output stream. |
Value |
fputcsv(Env env,
BinaryOutput os,
ArrayValue value,
StringValue delimiter,
StringValue enclosure)
Parses a comma-separated-value line from a file. |
static Value |
fputs(Env env,
BinaryOutput os,
java.io.InputStream value,
int length)
Writes a string to the file. |
static Value |
fread(Env env,
BinaryInput is,
int length)
Reads content from a file. |
static Value |
fscanf(Env env,
BinaryInput is,
StringValue format,
Value[] args)
Reads and parses a line. |
static Value |
fseek(Env env,
BinaryStream binaryStream,
long offset,
int whence)
Sets the current position. |
static Value |
fstat(Env env,
BinaryStream stream)
Returns the status of the given file pointer. |
static Value |
ftell(Env env,
BinaryStream binaryStream)
Returns the current position. |
static boolean |
ftruncate(Env env,
BinaryOutput handle,
long size)
Truncates a file. |
static Value |
fwrite(Env env,
BinaryOutput os,
java.io.InputStream value,
int length)
Writes a string to the file. |
java.util.Map<StringValue,Value> |
getConstMap()
Returns the constants defined by this module. |
static java.lang.String |
getcwd(Env env)
Returns the current working directory. |
IniDefinitions |
getIniDefinitions()
Returns the default quercus.ini values. |
static Value |
glob(Env env,
java.lang.String pattern,
int flags)
Matches all files with the given pattern. |
static boolean |
is_dir(Path path)
Returns true if the path is a directory. |
static boolean |
is_executable(Env env,
Path path)
Returns true if the path is an executable file |
static boolean |
is_file(Path path)
Returns true if the path is a file. |
static boolean |
is_link(Env env,
Path path)
Returns true if the path is a symbolic link |
static boolean |
is_readable(Path path)
Returns true if the path is readable |
static boolean |
is_uploaded_file(Env env,
Path path)
Returns true for an uploaded file. |
static boolean |
is_writable(Path path)
Returns true if the path is writable |
static boolean |
is_writeable(Path path)
Returns true if the path is writable |
boolean |
link(Env env,
Path source,
Path destination)
Creates a hard link |
static long |
linkinfo(Env env,
Path path)
|
static Value |
lstat(Env env,
StringValue filename)
Returns file statistics |
static boolean |
mkdir(Env env,
StringValue dirname,
int mode,
boolean recursive,
Value context)
Makes the directory |
static boolean |
move_uploaded_file(Env env,
Path src,
Path dst)
Moves the uploaded file. |
static Value |
opendir(Env env,
StringValue pathName,
Value context)
Opens a directory |
static Value |
parse_ini_file(Env env,
Path path,
boolean processSections)
Parses the ini file. |
static Value |
pathinfo(Env env,
java.lang.String path,
Value optionsV)
Parses the path, splitting it into parts. |
static int |
pclose(Env env,
BinaryStream stream)
|
static BinaryStream |
popen(Env env,
java.lang.String command,
StringValue mode)
|
static Value |
readdir(Env env,
DirectoryValue dir)
Reads the next entry |
Value |
readfile(Env env,
StringValue filename,
boolean useIncludePath,
Value context)
Read the contents of a file and write them out. |
static Value |
readlink(Env env,
Path path)
The readlink |
static Value |
realpath(Env env,
Path path)
Returns the actual path name. |
static boolean |
rename(Env env,
StringValue from,
StringValue to)
Renames a file |
static Value |
rewind(Env env,
BinaryStream binaryStream)
Rewinds the stream. |
static void |
rewinddir(Env env,
DirectoryValue dir)
Rewinds the directory listing |
static boolean |
rmdir(Env env,
StringValue filename,
Value context)
remove a directory |
static Value |
scandir(Env env,
StringValue fileName,
int order,
Value context)
Scan the directory |
static int |
set_file_buffer(Env env,
BinaryOutput stream,
int bufferSize)
Sets the write buffer. |
static Value |
stat(Env env,
StringValue filename)
Returns file statistics |
boolean |
symlink(Env env,
Path source,
Path destination)
Creates a symlink |
static java.lang.String |
tempnam(Env env,
Path dir,
java.lang.String prefix)
Creates a temporary file. |
static FileInputOutput |
tmpfile(Env env)
Creates a temporary file. |
static boolean |
touch(Env env,
Path path,
int time,
int atime)
sets the time to the current time |
static int |
umask(Env env,
int maskV)
umask call |
static boolean |
unlink(Env env,
StringValue filename,
Value context)
remove call |
| Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule |
|---|
addConstant, addConstant, addConstant, getLoadedExtensions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DIRECTORY_SEPARATOR
public static final java.lang.String PATH_SEPARATOR
public static final int UPLOAD_ERR_OK
public static final int UPLOAD_ERR_INI_SIZE
public static final int UPLOAD_ERR_FORM_SIZE
public static final int UPLOAD_ERR_PARTIAL
public static final int UPLOAD_ERR_NO_FILE
public static final int UPLOAD_ERR_NO_TMP_DIR
public static final int UPLOAD_ERR_CANT_WRITE
public static final int UPLOAD_ERR_EXTENSION
public static final int FILE_USE_INCLUDE_PATH
public static final int FILE_IGNORE_NEW_LINES
public static final int FILE_SKIP_EMPTY_LINES
public static final int FILE_APPEND
public static final int LOCK_SH
public static final int LOCK_EX
public static final int LOCK_UN
public static final int LOCK_NB
public static final int FNM_PATHNAME
public static final int FNM_NOESCAPE
public static final int FNM_PERIOD
public static final int FNM_CASEFOLD
public static final int GLOB_MARK
public static final int GLOB_NOSORT
public static final int GLOB_NOCHECK
public static final int GLOB_NOESCAPE
public static final int GLOB_BRACE
public static final int GLOB_ONLYDIR
public static final int GLOB_ERR
public static final int PATHINFO_DIRNAME
public static final int PATHINFO_BASENAME
public static final int PATHINFO_EXTENSION
public static final int PATHINFO_FILENAME
public static final int SEEK_SET
public static final int SEEK_CUR
public static final int SEEK_END
| Constructor Detail |
|---|
public FileModule()
| Method Detail |
|---|
public IniDefinitions getIniDefinitions()
getIniDefinitions in interface QuercusModulegetIniDefinitions in class AbstractQuercusModulepublic java.util.Map<StringValue,Value> getConstMap()
getConstMap in interface QuercusModulegetConstMap in class AbstractQuercusModule
public static Value basename(StringValue path,
StringValue suffix)
public static boolean chdir(Env env,
Path path)
path - the path to change to
public static boolean chroot(Env env,
Path path)
path - the path to change to
public static boolean chgrp(Env env,
Path file,
Value group)
env - the PHP executing environmentfile - the file to change the group ofgroup - the group id to change to
public static boolean chmod(Env env,
Path file,
int mode)
env - the PHP executing environmentfile - the file to change the group ofmode - the mode id to change to
public static boolean chown(Env env,
Path file,
Value user)
env - the PHP executing environmentfile - the file to change the group ofuser - the user id to change topublic static Value clearstatcache(Env env)
env - the PHP executing environment
public static boolean copy(Env env,
Path src,
Path dst)
src - the source pathdst - the destination path
public static Directory dir(Env env,
Path path)
path - the path to change to
public StringValue dirname(Env env,
StringValue path)
public static Value disk_free_space(Env env,
Path directory)
directory - the disk directory
public static Value disk_total_space(Env env,
Path directory)
directory - the disk directory
public static Value diskfreespace(Env env,
Path directory)
directory - the disk directory
public static boolean fclose(Env env,
BinaryStream s)
public static boolean feof(Env env,
BinaryStream binaryStream)
public static boolean fflush(Env env,
BinaryOutput os)
public static Value fgetc(Env env,
BinaryInput is)
public Value fgetcsv(Env env,
BinaryInput is,
int length,
java.lang.String delimiter,
java.lang.String enclosure)
file - the file to readlength - the maximum line lengthdelimiter - optional comma replacementenclosure - optional quote replacement
public static Value fgets(Env env,
BinaryInput is,
int length)
public static Value fgetss(Env env,
BinaryInput is,
int length,
Value allowedTags)
public static Value file(Env env,
StringValue filename,
int flags,
Value context)
filename - the file's nameuseIncludePath - if 1, use the include pathcontext - the resource context
public static Value fileatime(Env env,
Path path)
path - the path to check
public static Value filectime(Env env,
Path path)
path - the path to check
public static Value filegroup(Env env,
Path path)
path - the path to check
public static Value fileinode(Env env,
Path path)
path - the path to check
public static Value filemtime(Env env,
Path path)
path - the path to check
public static Value fileowner(Env env,
Path path)
path - the path to check
public static Value fileperms(Env env,
Path path)
path - the path to check
public static Value filesize(Env env,
Path path)
path - the path to check
public static Value filetype(Env env,
Path path)
path - the path to checkpublic static boolean file_exists(Path path)
path - the path to check
public static StringValue file_get_contents(Env env,
StringValue filename,
boolean useIncludePath,
Value context,
long offset,
long maxLen)
filename - the file's nameuseIncludePath - if true, use the include pathcontext - the resource context
public static Value file_put_contents(Env env,
StringValue filename,
Value data,
int flags,
Value context)
public static boolean flock(Env env,
LockableStream fileV,
int operation,
Value wouldBlock)
fileV - the file handleoperation - the locking operationwouldBlock - the resource context
public static boolean fnmatch(Env env,
java.lang.String pattern,
java.lang.String string,
int flags)
public static BinaryStream fopen(Env env,
StringValue filename,
java.lang.String mode,
boolean useIncludePath,
Value contextV)
filename - the path to the file to openmode - the mode the file should be opened as.useIncludePath - if true, search the current include path
public Value fpassthru(Env env,
BinaryInput is)
public Value fputcsv(Env env,
BinaryOutput os,
ArrayValue value,
StringValue delimiter,
StringValue enclosure)
file - the file to readdelimiter - optional comma replacementenclosure - optional quote replacement
public static Value fputs(Env env,
BinaryOutput os,
java.io.InputStream value,
int length)
public static Value fread(Env env,
BinaryInput is,
int length)
is - the file
public static Value fscanf(Env env,
BinaryInput is,
StringValue format,
Value[] args)
public static Value fseek(Env env,
BinaryStream binaryStream,
long offset,
int whence)
is - the stream to test
public static Value fstat(Env env,
BinaryStream stream)
public static Value ftell(Env env,
BinaryStream binaryStream)
file - the stream to test
public static boolean ftruncate(Env env,
BinaryOutput handle,
long size)
public static Value fwrite(Env env,
BinaryOutput os,
java.io.InputStream value,
int length)
public static Value glob(Env env,
java.lang.String pattern,
int flags)
public static java.lang.String getcwd(Env env)
public static boolean is_dir(Path path)
path - the path to check
public static boolean is_executable(Env env,
Path path)
path - the path to checkpublic static boolean is_file(Path path)
path - the path to check
public static boolean is_link(Env env,
Path path)
path - the path to checkpublic static boolean is_readable(Path path)
path - the path to check
public static boolean is_uploaded_file(Env env,
Path path)
path - the temp name of the uploaded filepublic static boolean is_writable(Path path)
path - the path to checkpublic static boolean is_writeable(Path path)
path - the path to check
public boolean link(Env env,
Path source,
Path destination)
public static long linkinfo(Env env,
Path path)
public static Value lstat(Env env,
StringValue filename)
public static boolean mkdir(Env env,
StringValue dirname,
int mode,
boolean recursive,
Value context)
path - the directory to make
public static boolean move_uploaded_file(Env env,
Path src,
Path dst)
path - the temp name of the uploaded filedst - the destination path
public static Value opendir(Env env,
StringValue pathName,
Value context)
pathName - the directory to open
public static Value parse_ini_file(Env env,
Path path,
boolean processSections)
public static Value pathinfo(Env env,
java.lang.String path,
Value optionsV)
public static int pclose(Env env,
BinaryStream stream)
public static BinaryStream popen(Env env,
java.lang.String command,
StringValue mode)
public static Value readdir(Env env,
DirectoryValue dir)
dirV - the directory resource
public Value readfile(Env env,
StringValue filename,
boolean useIncludePath,
Value context)
public static Value readlink(Env env,
Path path)
public static Value realpath(Env env,
Path path)
public static boolean rename(Env env,
StringValue from,
StringValue to)
fromPath - the path to change totoPath - the path to change to
public static Value rewind(Env env,
BinaryStream binaryStream)
is - the file resource
public static void rewinddir(Env env,
DirectoryValue dir)
dirV - the directory resource
public static boolean rmdir(Env env,
StringValue filename,
Value context)
public static Value closedir(Env env,
DirectoryValue dirV)
dirV - the directory resource
public static Value scandir(Env env,
StringValue fileName,
int order,
Value context)
fileName - the directory
public static int set_file_buffer(Env env,
BinaryOutput stream,
int bufferSize)
public static Value stat(Env env,
StringValue filename)
public boolean symlink(Env env,
Path source,
Path destination)
public static java.lang.String tempnam(Env env,
Path dir,
java.lang.String prefix)
public static FileInputOutput tmpfile(Env env)
public static boolean touch(Env env,
Path path,
int time,
int atime)
public static int umask(Env env,
int maskV)
public static boolean unlink(Env env,
StringValue filename,
Value context)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||