05-14-2009
madavise seem interesting.
So it's either
mmap + madavise( MADV_SEQUENTIAL )orsetvbuf + readahead + fread
although I'm not sure I understood how readahead is supposed to be used,
that is, can I tell him I wanna read the whole file (magnitude of giga bytes)
or should I tell him chunk by chunk?
It's becoming an interesting thread btw. :-)
Thanks to all of you guys.
10 More Discussions You Might Find Interesting
1. Linux
Hi all,
I am currently working on building a GUI to be interfaced with CUPS 1.3.4 package; In my GUI I have a list of printer manufacturers mapped
With various printer models ; and for a particular printer model selected I needed to know how to map that model with an Appropriate ppd file; as I... (0 Replies)
Discussion started by: sc3008
0 Replies
2. Shell Programming and Scripting
Hello,
I've been struggling with this for some time but can't find a way to do it and I haven't found any other similar thread.
I'd like to get the 'fields' in a line from a file into variables in just one command.
The file contains data with the next structure:... (4 Replies)
Discussion started by: semaler
4 Replies
3. Shell Programming and Scripting
I'm new of UNIX shell scripting. I'm recently generating a excel report in UNIX(file with delimiter is fine). How should I make a script to do it?
1 file to join comes from output of one UNIX command, the second from another UNIX command, and third from a database query. The key columes of all... (7 Replies)
Discussion started by: bigsmile
7 Replies
4. Shell Programming and Scripting
help me pls.. :(
i want to read a mapping file.
Below is the content of my mapping file.
6221,189,SMSC1,OMC1,WAP1
6223,188,SMSC2,OMC2,WAP2
so when my program running
msisdn="622130302310"
while not EOF
if substring($msisdn,1,4) == "6221" -- > "6221" read from the file
then
echo... (0 Replies)
Discussion started by: voidmain
0 Replies
5. Shell Programming and Scripting
Hi All,
My shell script is calculating the count of each shortcode series wise whose sample output is as follows:
--------------------------
56882
9124 1
9172 1
9173 4
8923 6
9175 1
9058 2
7398 2
--------------------------
58585
series count
9124 1
8858 17
9061 21
9125 21 (10 Replies)
Discussion started by: poweroflinux
10 Replies
6. Shell Programming and Scripting
Hello,
I do not know if this is the right title to use. I have a large dictionary database which has the following structure:
where a b c d e are in English and p q r s t are in a target language., the two separated by the delimiter =.
What I am looking for is a perl script which will take... (5 Replies)
Discussion started by: gimley
5 Replies
7. UNIX for Dummies Questions & Answers
Hi Guys,
Please help me with my problem here:
I have a source file:
1212 23232 343434 ASAS1 4
3212 23232 343434 ASAS2 4
3234 23232 343434 QWQW1 4
1134 23232 343434 QWQW2 4
3212 23232 343434 QWQW3 4
and a mapping... (4 Replies)
Discussion started by: kokoro
4 Replies
8. Shell Programming and Scripting
Hello,
I have a special problem. I have a file in 8 bit and would like to convert the whole database to 16Bit unicode.
The mapping file has the following structure:
The mapper is provided as a zip file
The target file to be converted contains data in English and 8 bit Urdu mapping, a... (4 Replies)
Discussion started by: gimley
4 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
i have a requirement where i need to format the input RAW file ( which is CSV) by using another mapping file(also CSV file). basically i am getting feed file with dynamic headers by using mapping file (in that target field is mapped with source filed) i have to convert the raw file into... (6 Replies)
Discussion started by: ravi4informatic
6 Replies
10. Shell Programming and Scripting
i have a real data prod file with 80+ fields containing 1k -2k records. i have to extract say 12 columns out of this which are sensitive fields along with one primary key say SEQ_ID (like DOB,account no, name, SEQ_ID, govtid etc) in a lookup file. i have to replace these sensitive fields in... (11 Replies)
Discussion started by: megh12
11 Replies
LEARN ABOUT DEBIAN
readahead
READAHEAD(2) Linux Programmer's Manual READAHEAD(2)
NAME
readahead - perform file readahead into page cache
SYNOPSIS
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <fcntl.h>
ssize_t readahead(int fd, off64_t offset, size_t count);
DESCRIPTION
readahead() populates the page cache with data from a file so that subsequent reads from that file will not block on disk I/O. The fd
argument is a file descriptor identifying the file which is to be read. The offset argument specifies the starting point from which data
is to be read and count specifies the number of bytes to be read. I/O is performed in whole pages, so that offset is effectively rounded
down to a page boundary and bytes are read up to the next page boundary greater than or equal to (offset+count). readahead() does not read
beyond the end of the file. readahead() blocks until the specified data has been read. The current file offset of the open file referred
to by fd is left unchanged.
RETURN VALUE
On success, readahead() returns 0; on failure, -1 is returned, with errno set to indicate the cause of the error.
ERRORS
EBADF fd is not a valid file descriptor or is not open for reading.
EINVAL fd does not refer to a file type to which readahead() can be applied.
VERSIONS
The readahead() system call appeared in Linux 2.4.13; glibc support has been provided since version 2.3.
CONFORMING TO
The readahead() system call is Linux-specific, and its use should be avoided in portable applications.
SEE ALSO
lseek(2), madvise(2), mmap(2), posix_fadvise(2), read(2)
COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2010-09-10 READAHEAD(2)