JX Application Framework
Loading...
Searching...
No Matches
Functions
jFileUtil_UNIX.cpp File Reference
#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"
Include dependency graph for jFileUtil_UNIX.cpp:

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)
 

Function Documentation

◆ JCreateTempFile()

JError JCreateTempFile ( const JString path,
const JString prefix,
JString fullName 
)

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_.

◆ JFileExecutable()

bool JFileExecutable ( const JString fileName)

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.

◆ JFileExists()

bool JFileExists ( const JString fileName)

Returns true if the specified file exists.

◆ JFileReadable()

bool JFileReadable ( const JString fileName)

Returns true if the specified file can be read from.

◆ JFileWritable()

bool JFileWritable ( const JString fileName)

Returns true if the specified file can be written to.

◆ JGetFileLength()

JError JGetFileLength ( const JString name,
JSize size 
)

Sets *size to the the length of the specified file. Can return JDirEntryDoesNotExist.

◆ JKillFile()

bool JKillFile ( const JString fileName)

Tries as hard as it can to delete the file. Returns true if successful.

◆ JRemoveFile()

JError JRemoveFile ( const JString fileName)

◆ JStripTrailingDirSeparator()

void JStripTrailingDirSeparator ( JString dirName)

◆ JUncompressFile()

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.