#include <SysFileSystem.hpp>
Public Types | |
enum | { MaximumPathLength = MAXIMUM_PATH_LENGTH , MaximumFileNameLength = MAXIMUM_FILENAME_LENGTH , MaximumFileNameBuffer = MAXIMUM_PATH_LENGTH + MAXIMUM_FILENAME_LENGTH } |
enum | { MaximumPathLength = MAXIMUM_PATH_LENGTH , MaximumFileNameLength = MAXIMUM_FILENAME_LENGTH , MaximumFileNameBuffer = MAXIMUM_PATH_LENGTH + MAXIMUM_FILENAME_LENGTH } |
Static Public Member Functions | |
static const char * | getTempFileName () |
static bool | searchFileName (const char *name, char *fullName) |
static void | qualifyStreamName (const char *unqualifiedName, char *qualifiedName, size_t bufferSize) |
static bool | fileExists (const char *name) |
static bool | searchName (const char *name, const char *path, const char *extension, char *resolvedName) |
static bool | primitiveSearchName (const char *name, const char *path, const char *extension, char *resolvedName) |
static bool | checkCurrentFile (const char *name, char *resolvedName) |
static bool | searchPath (const char *name, const char *path, char *resolvedName) |
static bool | hasExtension (const char *name) |
static bool | hasDirectory (const char *name) |
static bool | canonicalizeName (char *name) |
static bool | normalizePathName (const char *name, char *resolved) |
static RexxString * | extractDirectory (RexxString *file) |
static RexxString * | extractExtension (RexxString *file) |
static RexxString * | extractFile (RexxString *file) |
static bool | deleteFile (const char *name) |
static bool | deleteDirectory (const char *name) |
static bool | isDirectory (const char *name) |
static bool | isReadOnly (const char *name) |
static bool | isWriteOnly (const char *name) |
static bool | isFile (const char *name) |
static bool | exists (const char *name) |
static int64_t | getLastModifiedDate (const char *name) |
static uint64_t | getFileLength (const char *name) |
static bool | makeDirectory (const char *name) |
static bool | moveFile (const char *oldName, const char *newName) |
static bool | isHidden (const char *name) |
static bool | setLastModifiedDate (const char *name, int64_t time) |
static bool | setFileReadOnly (const char *name) |
static bool | isCaseSensitive () |
static int | getRoots (char *roots) |
static const char * | getSeparator () |
static const char * | getPathSeparator () |
static const char * | getTempFileName () |
static bool | searchFileName (const char *name, char *fullName) |
static void | qualifyStreamName (const char *unqualifiedName, char *qualifiedName, size_t bufferSize) |
static bool | fileExists (const char *name) |
static bool | hasExtension (const char *name) |
static bool | hasDirectory (const char *name) |
static RexxString * | extractDirectory (RexxString *file) |
static RexxString * | extractExtension (RexxString *file) |
static RexxString * | extractFile (RexxString *file) |
static bool | searchName (const char *name, const char *path, const char *extension, char *resolvedName) |
static bool | primitiveSearchName (const char *name, const char *path, const char *extension, char *resolvedName) |
static bool | checkCurrentFile (const char *name, char *resolvedName) |
static bool | searchPath (const char *name, const char *path, const char *extension, char *resolvedName) |
static void | getLongName (char *fullName, size_t size) |
static bool | findFirstFile (const char *name) |
static bool | deleteFile (const char *name) |
static bool | deleteDirectory (const char *name) |
static bool | isDirectory (const char *name) |
static bool | isReadOnly (const char *name) |
static bool | isWriteOnly (const char *name) |
static bool | isFile (const char *name) |
static bool | exists (const char *name) |
static int64_t | getLastModifiedDate (const char *name) |
static int64_t | getFileLength (const char *name) |
static bool | makeDirectory (const char *name) |
static bool | moveFile (const char *oldName, const char *newName) |
static bool | isHidden (const char *name) |
static bool | setLastModifiedDate (const char *name, int64_t time) |
static bool | setFileReadOnly (const char *name) |
static bool | isCaseSensitive () |
static int | getRoots (char *roots) |
static const char * | getSeparator () |
static const char * | getPathSeparator () |
Static Public Attributes | |
static const char | EOF_Marker = 0x1A |
static const char * | EOL_Marker = "\n" |
static const char | PathDelimiter = '/' |
static int | stdinHandle = 0 |
static int | stdoutHandle = 1 |
static int | stderrHandle = 2 |
Definition at line 75 of file unix/SysFileSystem.hpp.
anonymous enum |
Enumerator | |
---|---|
MaximumPathLength | |
MaximumFileNameLength | |
MaximumFileNameBuffer |
Definition at line 78 of file unix/SysFileSystem.hpp.
anonymous enum |
Enumerator | |
---|---|
MaximumPathLength | |
MaximumFileNameLength | |
MaximumFileNameBuffer |
Definition at line 56 of file windows/SysFileSystem.hpp.
|
static |
Process a file name to add the current working directory or the home directory, as needed, then remove all of the . and .. elements.
name | The current working name. |
Definition at line 579 of file unix/SysFileSystem.cpp.
References normalizePathName().
Referenced by checkCurrentFile(), qualifyStreamName(), searchFileName(), and searchPath().
|
static |
Try to locate a file using just the raw name passed in, as opposed to searching along a path for the name.
name | The name to use for the search. |
Definition at line 480 of file unix/SysFileSystem.cpp.
References canonicalizeName().
Referenced by primitiveSearchName().
|
static |
|
static |
Delete a directory from the file system.
name | The name of the target directory. |
Definition at line 786 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod1().
|
static |
|
static |
Delete a file from the file system.
name | The fully qualified name of the file. |
Definition at line 774 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod1().
|
static |
|
static |
Test if a file exists using a fully qualified name.
name | The target file name. |
Definition at line 861 of file unix/SysFileSystem.cpp.
Referenced by isHidden(), and RexxMethod1().
|
static |
|
static |
Extract directory information from a file name.
file | The input file name. If this represents a real source file, this will be fully resolved. |
Definition at line 254 of file unix/SysFileSystem.cpp.
References RexxString::getLength(), RexxString::getStringData(), new_string(), and OREF_NULL.
Referenced by RexxSource::extractNameInformation().
|
static |
|
static |
Extract extension information from a file name.
file | The input file name. If this represents a real source file, this will be fully resolved. |
Definition at line 286 of file unix/SysFileSystem.cpp.
References RexxString::getLength(), RexxString::getStringData(), new_string(), and OREF_NULL.
Referenced by RexxSource::extractNameInformation().
|
static |
|
static |
Extract file information from a file name.
file | The input file name. If this represents a real source file, this will be fully resolved. |
Definition at line 322 of file unix/SysFileSystem.cpp.
References RexxString::getLength(), RexxString::getStringData(), and new_string().
Referenced by RexxSource::extractNameInformation().
|
static |
|
static |
Test if a given file exists.
fname | The target file name. |
Check to see if a file with a given name exists.
name | The name to check. |
Definition at line 228 of file unix/SysFileSystem.cpp.
Referenced by searchFileName(), StreamInfo::streamExists(), and StreamInfo::streamOpen().
|
static |
|
static |
Perform a "find first" operation for a file.
name | the target name (may include wildcard characters) |
Definition at line 186 of file windows/SysFileSystem.cpp.
|
static |
Retrieve the size of a file.
name | The name of the target file. |
Definition at line 898 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod1().
|
static |
|
static |
Get the last modified file date as a file time value.
name | The target name. |
Get the last modified file date as a file time value.
name | The target name. |
Definition at line 878 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod1().
|
static |
|
static |
Get the actual name value of a located file, in the exact case used on the harddrive.
fullName | The buffer used for the name. |
size | The size of the buffer. |
Definition at line 531 of file windows/SysFileSystem.cpp.
Referenced by searchPath().
|
static |
Return the separator used for separating search path elements
Definition at line 1050 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod0().
|
static |
|
static |
Retrieve the file system root elements. On Windows, each of the drives is a root element.
Definition at line 1026 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod0().
|
static |
|
static |
Return the separator used for separating path names.
Definition at line 1039 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod0().
|
static |
|
static |
Generate a temporary file name.
Definition at line 178 of file unix/SysFileSystem.cpp.
Referenced by RexxMemory::checkSetOref(), and RexxMemory::orphanCheckMark().
|
static |
|
static |
Test if a filename has a directory portion
name | The name to check. |
Definition at line 385 of file unix/SysFileSystem.cpp.
Referenced by primitiveSearchName().
|
static |
|
static |
Test if a filename has an extension.
name | The name to check. |
Definition at line 352 of file unix/SysFileSystem.cpp.
Referenced by SysInterpreterInstance::resolveProgramName().
|
static |
|
static |
indicate whether the file system is case sensitive.
indicate whether the file system is case sensitive.
Definition at line 1014 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod0().
|
static |
|
static |
Test if a given file name is for a directory.
name | The target name. |
Definition at line 800 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod1().
|
static |
|
static |
Test if a give file name is for a real file (not a directory).
name | The target file name. |
Definition at line 845 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod1().
|
static |
|
static |
Test if a given file or directory is hidden.
name | The target name. |
Definition at line 943 of file unix/SysFileSystem.cpp.
References exists().
Referenced by RexxMethod1().
|
static |
|
static |
Test is a file is read only.
name | The target file name. |
Definition at line 816 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod1().
|
static |
|
static |
Test if a file is marked as write-only.
name | The target file name. |
Definition at line 830 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod1().
|
static |
|
static |
Create a directory in the file system.
name | The target name. |
Definition at line 916 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod1().
|
static |
|
static |
Move (rename) a file.
oldName | The name of an existing file. |
newName | The new file name. |
Definition at line 930 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod2().
|
static |
|
static |
Normalize an absolute Unix path name. Removes duplicate and trailing slashes, resolves and removes ./ or ../ This works for any path name, whether the resovled name exists or not.
name | The path name to normalize. |
resolved | On success the normalized name is returned here. |
@assumes Name is null-terminated and that resolved is an adequate buffer.
Definition at line 683 of file unix/SysFileSystem.cpp.
Referenced by canonicalizeName().
|
static |
Do a search for a single variation of a filename.
name | The name to search for. |
directory | A specific directory to look in first (can be NULL). |
extension | A potential extension to add to the file name (can be NULL). |
resolvedName | The buffer used to return the resolved file name. |
Do a search for a single variation of a filename.
NOTE: This version does not do anything with the kernel lock, so it is callable before the first activity is set up.
name | The name to search for. |
path | |
extension | A potential extension to add to the file name (can be NULL). |
resolvedName | The buffer used to return the resolved file name. |
Definition at line 425 of file unix/SysFileSystem.cpp.
References checkCurrentFile(), hasDirectory(), searchPath(), and Utilities::strlower().
Referenced by SystemInterpreter::loadImage(), and searchName().
|
static |
|
static |
Generate a fully qualified stream name.
unqualifiedName | The starting name. |
qualifiedName | The fully expanded and canonicalized file name. |
bufferSize |
Definition at line 184 of file unix/SysFileSystem.cpp.
References canonicalizeName(), and MaximumFileNameBuffer.
Referenced by BUILTIN(), SystemInterpreter::qualifyFileSystemName(), StreamInfo::resolveStreamName(), and RexxMethod1().
|
static |
|
static |
Definition at line 84 of file unix/SysFileSystem.cpp.
References canonicalizeName(), fileExists(), and MaximumFileNameBuffer.
|
static |
|
static |
Do a search for a single variation of a filename.
name | The name to search for. |
directory | A specific directory to look in first (can be NULL). |
extension | A potential extension to add to the file name (can be NULL). |
resolvedName | The buffer used to return the resolved file name. |
Definition at line 406 of file unix/SysFileSystem.cpp.
References primitiveSearchName().
Referenced by SysInterpreterInstance::resolveProgramName().
|
static |
|
static |
Do a path search for a file.
name | The name to search for. |
path | The search path to use. |
resolvedName | A buffer used for returning the resolved name. |
Definition at line 527 of file unix/SysFileSystem.cpp.
References canonicalizeName().
Referenced by primitiveSearchName().
|
static |
Do a path search for a file.
name | The name to search for. |
path | The search path to use. |
extension | Any extension that should be added to the search (can be NULL). |
resolvedName | A buffer used for returning the resolved name. |
Definition at line 502 of file windows/SysFileSystem.cpp.
References getLongName(), and SearchPath().
|
static |
Set the read-only attribute on a file or directory.
name | The target name. |
Definition at line 995 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod1().
|
static |
|
static |
Set the last modified date for a file.
name | The target name. |
time | The new file time (in ticks). |
Set the last modified date for a file.
name | The target name. |
time | The new file time. |
Open the path ensuring GENERIC_WRITE and FILE_FLAG_BACKUP_SEMANTICS if it's a directory. The directory modification is only supported on some platforms (NT, Windows2000).
Definition at line 972 of file unix/SysFileSystem.cpp.
Referenced by RexxMethod2().
|
static |
|
static |
Definition at line 85 of file unix/SysFileSystem.hpp.
|
static |
Definition at line 86 of file unix/SysFileSystem.hpp.
|
static |
Definition at line 87 of file unix/SysFileSystem.hpp.
|
static |
Definition at line 65 of file windows/SysFileSystem.hpp.
|
static |
Definition at line 63 of file windows/SysFileSystem.hpp.
|
static |
Definition at line 64 of file windows/SysFileSystem.hpp.