explain_truncate_or_die(3) Library Functions Manual explain_truncate_or_die(3)NAME
explain_truncate_or_die - truncate a file and report errors
SYNOPSIS
#include <libexplain/truncate.h>
void explain_truncate_or_die(const char *pathname, long long length);
DESCRIPTION
The explain_truncate_or_die function is used to call the truncate(2) system call. On failure an explanation will be printed to stderr,
obtained from explain_truncate(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_truncate_or_die(pathname, length);
pathname
The pathname, exactly as to be passed to the truncate(2) system call.
length The length, exactly as to be passed to the truncate(2) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
SEE ALSO truncate(2)
truncate a file to a specified length
explain_truncate(3)
explain truncate(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_truncate_or_die(3)
Check Out this Related Man Page
explain_ftruncate_or_die(3) Library Functions Manual explain_ftruncate_or_die(3)NAME
explain_ftruncate_or_die - truncate a file and report errors
SYNOPSIS
#include <libexplain/ftruncate.h>
void explain_ftruncate_or_die(int fildes, long long length);
DESCRIPTION
The explain_ftruncate_or_die function is used to call the ftruncate(2) system call. On failure an explanation will be printed to stderr,
obtained from explain_ftruncate(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_ftruncate_or_die(fildes, length);
fildes The fildes, exactly as to be passed to the ftruncate(2) system call.
length The length, exactly as to be passed to the ftruncate(2) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
SEE ALSO ftruncate(2)
truncate a file to a specified length
explain_ftruncate(3)
explain ftruncate(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_ftruncate_or_die(3)
Hello,
I need to truncate a large file without deleting and touching it again.
i tried the below commands but no use because of the huge file size
cat <<! > errors
and
echo > errors
Could someone please help.
Thanks,
Sateesh (1 Reply)
Hi,
I was working on the truncate oracle table shell script. The script is supplied with one table name as a parameter and I would like to change it so that it is passed a file name with a list of tables. And the script needs to truncate tables one by one by looping through the file. In other... (10 Replies)
Hi all,
I'm trying to truncate a number like the following:
0001060407013900501048239559900600504083525826350002050354795057
I would like to create an output which puts carriage returns every so many characters, giving an output such as:
0001
060407
0139
0
05
010482395599
0060... (4 Replies)
Hi All,
I have an application which writes log in to a file. The file size becomes around min of 800 MB a day. So I have written a script which backup the file and truncate the original file. My script is like this
cp X.log /backup/X.log1
> X.log
But the second truncate command... (3 Replies)
Hi all!
POSIX shell on an HP.
I have a comma separated file. The first field is a numeric, with a length between 8 and 13. If the field has a length of 13, I would like to truncate the left most (leading) digit. It may be a zero.
Thanks!!! (2 Replies)
Hi,
I need to truncate a file based on date.Suppose i have a log file which is getting updated every date,i need to keep 7 days worth of data(like sysdate-7) and rest i want to truncate it.Can some help me? (5 Replies)
Hi,
I have a issue, I need to loop through a comma delimited file and check for the length which exceeds specified length , if Yes truncate the string.
But my problem is , I do not have to check for all the fields and the field lenght is not same for all the fields.
For ex:
Say my line... (9 Replies)
Hi All,
I have a requirement, where i have to pool file A data to file B continuously and need to process the data in the file B.
Since the data need to be processed only once so i have to truncate the data in file A after every pool. So that on the next pooling i can get the fresh data and... (3 Replies)