sttmpfiles(3) ShapeTools Toolkit Library sttmpfiles(3)NAME
stTmpFile, stRegisterFile, stUnRegisterFile, stRmRegisteredFiles - temporary files handling
SYNOPSIS
#include <config.h>
#include <sttk.h>
char*stTmpFile (char *path);
voidstRegisterFile (char *fileName);
voidstUnRegisterFile (char *fileName);
voidstRmRegisteredFiles (void);
DESCRIPTION
stTmpFile creates a unique filename for a temporary file, registers it (see stRegisterFile below), and returns it. The return value
resides in static memory and will be overwritten on the next call of stTmpFile. The temporary file is located in the /tmp directory.
stRegisterFile adds the given fileName to an internal static list of file names. This list helps to keep track of the names of all tempo-
rary files to be deleted until the end of the program execution. On abnormal program termination (signal), the termination handler may call
stRmRegisteredFiles to delete all registered files. This avoids bogus temporary files to survive abnormal program termination.
stUnRegisterFile removes fileName from the internal list of file names. It should be called when the corresponding file was removed due to
the regular control flow.
stRmRegisteredFiles removes all files named in the internal list set up by stTmpFile and stRegisterFile and clears the list. Bogus entries
in the list (names without a correponding file) are ignored. Invoking stCatchSigs(3) causes stRmRegisteredFiles to be called on occurence
of the signals SIGQUIT, SIGFPE, SIGBUS, SIGSEGV, and SIGTERM. stCleanup(3) also calls stRmRegisteredFiles.
SEE ALSO stCatchSigs(3), stCleanup(3)LIMITS
The maximum number of temporary files to be registered is 16.
sttk-1.7 Thu Jun 24 17:43:36 1993 sttmpfiles(3)
Check Out this Related Man Page
sttmpfiles(3) ShapeTools Toolkit Library sttmpfiles(3)NAME
stTmpFile, stRegisterFile, stUnRegisterFile, stRmRegisteredFiles - temporary files handling
SYNOPSIS
#include <config.h>
#include <sttk.h>
char*stTmpFile (char *path);
voidstRegisterFile (char *fileName);
voidstUnRegisterFile (char *fileName);
voidstRmRegisteredFiles (void);
DESCRIPTION
stTmpFile creates a unique filename for a temporary file, registers it (see stRegisterFile below), and returns it. The return value
resides in static memory and will be overwritten on the next call of stTmpFile. The temporary file is located in the /tmp directory.
stRegisterFile adds the given fileName to an internal static list of file names. This list helps to keep track of the names of all tempo-
rary files to be deleted until the end of the program execution. On abnormal program termination (signal), the termination handler may call
stRmRegisteredFiles to delete all registered files. This avoids bogus temporary files to survive abnormal program termination.
stUnRegisterFile removes fileName from the internal list of file names. It should be called when the corresponding file was removed due to
the regular control flow.
stRmRegisteredFiles removes all files named in the internal list set up by stTmpFile and stRegisterFile and clears the list. Bogus entries
in the list (names without a correponding file) are ignored. Invoking stCatchSigs(3) causes stRmRegisteredFiles to be called on occurence
of the signals SIGQUIT, SIGFPE, SIGBUS, SIGSEGV, and SIGTERM. stCleanup(3) also calls stRmRegisteredFiles.
SEE ALSO stCatchSigs(3), stCleanup(3)LIMITS
The maximum number of temporary files to be registered is 16.
sttk-1.7 Thu Jun 24 17:43:36 1993 sttmpfiles(3)
Hi,
I have a program that gets called from the front end of my application. Actually it creates some temporary files and uses them and deletes them at last. But sometimes, say once in 6 times, some of these temporary files are getting truncated in the middle and because of this my program is... (9 Replies)
remotePath=$1
fileName=$2
remoteUser=$3
remoteServer=$4
echo " if ; then echo '0'; else echo '1'; fi " > temp_command.log
command1=`cat temp_command.log`
ssh $remoteUser@$remoteServer $command1
rm temp_command.log
Above code is to check whether the file in remote server is exist. It... (1 Reply)
Hi,
I have hundreds of files "*.out" located in one folder,
and I want to:
1. Identify the good files containing "Normal termination" (grep "Normal termination" *.out )
2. Compress the good files into a tar.gz file (tar cvfz good.tar.gz *.goog.out )
Is there a way I can automate this... (4 Replies)
Hi,
Some porocess is creating hidden temporary files in /tmp directory. And they are not getting deleted. System is going out of disk space after some days.
The temp files are getting created like .<user name><pid>. I have checked the application code, but didnt get any clue. Does these files... (4 Replies)
ls -c /dir1/dir2/test* | while read fileName
do
mv $fileName ${TargetDir}
echo "Moving file: ${fileName} to ${TargetDir}" >> $LOGFILE
done
In the above scenarion it will move all the files which is having pattern test* from the current... (5 Replies)