JX Application Framework
|
#include "jFileUtil.h"
#include "jDirUtil.h"
#include "JStdError.h"
#include "JStringIterator.h"
#include "JProcess.h"
#include <unistd.h>
#include <sys/stat.h>
#include <ace/OS_NS_sys_stat.h>
#include <stdio.h>
#include "jErrno.h"
#include "jAssert.h"
Functions | |
bool | JFileExists (const JString &fileName) |
bool | JFileReadable (const JString &fileName) |
bool | JFileWritable (const JString &fileName) |
bool | JFileExecutable (const JString &fileName) |
JError | JGetFileLength (const JString &name, JSize *size) |
JError | JRemoveFile (const JString &fileName) |
bool | JKillFile (const JString &fileName) |
JError | JCreateTempFile (const JString *path, const JString *prefix, JString *fullName) |
void | JStripTrailingDirSeparator (JString *dirName) |
JError | JUncompressFile (const JString &origFileName, JString *newFileName, const JString &dirName, JProcess **process) |
Creates a unique file in the specified directory. If path is empty, it uses the system's scratch directory. If prefix is empty, uses temp_file_.
Returns true if the specified file can be executed.
Readability is not checked, because this is only an issue for scripts, and I can't tell the difference between a script and a binary.
Returns true if the specified file can be written to.
Sets *size to the the length of the specified file. Can return JDirEntryDoesNotExist.
Tries as hard as it can to delete the file. Returns true if successful.
Removes the specified file.
Can return JSegFault, JAccessDenied, JNameTooLong, JBadPath, JComponentNotDirectory, JTriedToRemoveDirectory, JNoKernelMemory, JFileSystemReadOnly.
void JStripTrailingDirSeparator | ( | JString * | dirName | ) |
JError JUncompressFile | ( | const JString & | origFileName, |
JString * | newFileName, | ||
const JString & | dirName, | ||
JProcess ** | process | ||
) |
Uncompresses the file named origFileName.
If newFileName is empty, we generate a unique name and return it. If dirName is not empty, we place the new file there. If process is not nullptr, we return the one we create without blocking. Otherwise, we block until the process finishes.