Does anyone know how to display the time with seconds
of when a file was last modified. I can get hour & minutes but
would also like seconds. --Running AIX (1 Reply)
Hi
I am accessing a file on nfs mounted device, after completing using of the file, i am tring to restore the access time and modification times of the file.
So i got the previous modified time of the file using stat() function and trying to set the date and time for the file, To set these... (6 Replies)
Can anyone please suggest an alternate command for "stat" . I am trying this on Solaris 5.9 , but the command doesn't exist.
Basically i need to see one particalar file modification history. Any help is appreciated. (4 Replies)
Hi,
I have a file test.txt . The contain of the file is as below :
365798~SAPUS~PR5~0000799005~ADM CHARG MEDCAL INS~~~~~~~~~~~~~~~~~~~~~~~~SLAC480
I want to modify this file. And file contain loking like
"365798"~"SAPUS"~"PR5"~"0000799005"~"ADM CHARG MEDCAL... (6 Replies)
Hi,
I have a file abcd.txt.
cat abcd.txt
output is as follows :
"aa"~"bb"~"001"~""~""~"cc"
"dd"~"005"~""
~""~"kk"~"aa"~"00
8"~""~""~
I want the output looking like:
cat abcd.txt
"aa"~"bb"~"001"~""~""~
"cc""dd"~"005"~""~""~
"kk"~"aa"~"008"~""~""~
I have a script. (4 Replies)
Hi All,
I have a file disk_space.log.
cat disk_space.log
94% /
32% /boot
38% /mnt/data
100% /media/CDROM
I want the output, like
cat disk_space.log
94% /
100% /media/CDROM
That means print the line those are grater-than 90%. And rest of the line is remove from file.
I have a... (2 Replies)
Hi All, I have a file. This file contain huge amount of data. I want to modify this file. I want enter new line when count of "~ character is 79. Please find below the code : cat file_name | tr -d '\n' | sed... (6 Replies)
Hi, I have a file input.txt. cat input.txt output is as follows : Code: "0001"~"name"~"bb"~"20.25"~""~""~"0002"~"name" "dd"~"35.50"~"" ~""~"0003"~"name"~"aa"~"21.3 5"~""~""~ I want the output looking like: cat output.txt Code: "0001"~"name"~"bb"~"20.25"~""~""~... (6 Replies)
HI All,
I have a file with content as below
Filename:
my name is xyz
my name abc
my name is bdf
end
Filename:
my name uvx
my name edd
my name jhn
end
i want to edit the content and save into another file as
Filename1:
my name is xyz
Filename1:
my name abc
Filename1:
my name is... (4 Replies)
Discussion started by: jhon1257
4 Replies
LEARN ABOUT MOJAVE
getdelim
GETLINE(3) BSD Library Functions Manual GETLINE(3)NAME
getdelim, getline -- get a line from a stream
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdio.h>
ssize_t
getdelim(char ** restrict linep, size_t * restrict linecapp, int delimiter, FILE * restrict stream);
ssize_t
getline(char ** restrict linep, size_t * restrict linecapp, FILE * restrict stream);
DESCRIPTION
The getdelim() function reads a line from stream, delimited by the character delimiter. The getline() function is equivalent to getdelim()
with the newline character as the delimiter. The delimiter character is included as part of the line, unless the end of the file is reached.
The caller may provide a pointer to a malloced buffer for the line in *linep, and the capacity of that buffer in *linecapp. These functions
expand the buffer as needed, as if via realloc(). If linep points to a NULL pointer, a new buffer will be allocated. In either case, *linep
and *linecapp will be updated accordingly.
RETURN VALUES
The getdelim() and getline() functions return the number of characters written, excluding the terminating NUL character. The value -1 is
returned if an error occurs, or if end-of-file is reached.
EXAMPLES
The following code fragment reads lines from a file and writes them to standard output. The fwrite() function is used in case the line con-
tains embedded NUL characters.
char *line = NULL;
size_t linecap = 0;
ssize_t linelen;
while ((linelen = getline(&line, &linecap, fp)) > 0)
fwrite(line, linelen, 1, stdout);
ERRORS
These functions may fail if:
[EINVAL] Either linep or linecapp is NULL.
[EOVERFLOW] No delimiter was found in the first SSIZE_MAX characters.
These functions may also fail due to any of the errors specified for fgets() and malloc().
SEE ALSO fgetln(3), fgets(3), malloc(3)STANDARDS
The getdelim() and getline() functions conform to IEEE Std 1003.1-2008 (``POSIX.1'').
HISTORY
These routines first appeared in FreeBSD 8.0.
BUGS
There are no wide character versions of getdelim() or getline().
BSD November 30, 2010 BSD