9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
greetings,
i'll start by stating; i am NOT looking for the EXACT syntax to my query but a simple yes or no of its possibility. and if you're feeling generous maybe the php function(s) that i'd use as a jump start. i could use bash but i really want to take a shot at doing this with php. the... (0 Replies)
Discussion started by: crimso
0 Replies
2. UNIX and Linux Applications
Hello everyone
I wanted to asked you guys for advice regarding the requirement to have Open LDAP Server in organization.
I installed Open LDAP Server, and also Client machine for testing before I put into production.
Everything works fine, along with a friendly web interface, him I add user... (1 Reply)
Discussion started by: James Stone
1 Replies
3. Shell Programming and Scripting
Hi,
I have a Report.txt file. Say the contents of this file are :
1 2 3 4 5 7 df v g gf
e r dfkf lsdk dslsdklsdk
Report Start: xxxxxxdad
asdffsdfsdfsdfasfasdffasdf
sadfasdfsadffsfsdf Report End.
sdfasdfasdf
sdfasfdasdfasdfasdfasdf
sadfasdfsdf
I need to grab from Report Start... (3 Replies)
Discussion started by: mrskittles99
3 Replies
4. Shell Programming and Scripting
Using awk how to delete chunk of text if it contains certain strings? As in the following, delete a reference chunk, i.e. everything from <reference attribute = "value"> to </reference> inclusive, if within it "Group ID" value is 7 or 96 or 103 or 1005.
<reference attribute = "value">
... (3 Replies)
Discussion started by: pioavi
3 Replies
5. Shell Programming and Scripting
Anybody know of a suite of server-validation tests? I am trying to build my own HTTP server, but do not know of all the status code responses (like "200 OK") or the internal methods (like "keep-alive") which should be implemented to be considered a "complete" solution.
Any help? (3 Replies)
Discussion started by: jjinno
3 Replies
6. Shell Programming and Scripting
Hi All,
Please find the sample file below:
NAME ID NUMBER
-------------------------------------------------------------------------------------------------- ---------
abcdefgheija;lksdf ... (13 Replies)
Discussion started by: niel.verty
13 Replies
7. Shell Programming and Scripting
I am new to Unix so will really appreciate if someone can guide me on this.
What I want to do is:
Step1: Read binary file - pick first 2 bytes, convert from hex to decimal. Read the next 3 bytes as well.
2 bytes will specify the number of bytes 'n' that I want to read and write... (1 Reply)
Discussion started by: Kbenipel
1 Replies
8. Shell Programming and Scripting
Hello the great gurus :)
I'm quite new to this, so perhaps I'm asking a simple and trivial question (which is good, because you'll answer for sure :))))
Anyway. I have an amount of *.c files (about 100), and what I want to do, is to surround a specific function call with #ifdef and #endif.
... (6 Replies)
Discussion started by: xxxaxa
6 Replies
9. UNIX for Dummies Questions & Answers
Hello all,
I am trying to add chunks to my informix dataspace. I have one dataspace ( the rootdbs ) and the new chunk is a raw device. Precisely slice1 on my new external harddisk.
The question is, what should be the offset value. The document says, the offset is used by the engine to... (1 Reply)
Discussion started by: shibz
1 Replies
pack_fopen_chunk(3alleg4) Allegro manual pack_fopen_chunk(3alleg4)
NAME
pack_fopen_chunk - Opens a sub-chunk of a file. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
PACKFILE *pack_fopen_chunk(PACKFILE *f, int pack);
DESCRIPTION
Opens a sub-chunk of a file. Chunks are primarily intended for use by the datafile code, but they may also be useful for your own file rou-
tines. A chunk provides a logical view of part of a file, which can be compressed as an individual entity and will automatically insert and
check length counts to prevent reading past the end of the chunk. The PACKFILE parameter is a previously opened file, and `pack' is a bool-
ean parameter which will turn compression on for the sub-chunk if it is non-zero. Example:
PACKFILE *output = pack_fopen("out.raw", "w!");
...
/* Create a sub-chunk with compression. */
output = pack_fopen_chunk(output, 1);
if (!output)
abort_on_error("Error saving data!");
/* Write some data to the sub-chunk. */
...
/* Close the sub-chunk, recovering parent file. */
output = pack_fclose_chunk(output);
The data written to the chunk will be prefixed with two length counts (32-bit, a.k.a. big-endian). For uncompressed chunks these will both
be set to the size of the data in the chunk. For compressed chunks (created by setting the `pack' flag), the first length will be the raw
size of the chunk, and the second will be the negative size of the uncompressed data.
To read the chunk, use the following code:
PACKFILE *input = pack_fopen("out.raw", "rp");
...
input = pack_fopen_chunk(input, 1);
/* Read data from the sub-chunk and close it. */
...
input = pack_fclose_chunk(input);
This sequence will read the length counts created when the chunk was written, and automatically decompress the contents of the chunk if it
was compressed. The length will also be used to prevent reading past the end of the chunk (Allegro will return EOF if you attempt this),
and to automatically skip past any unread chunk data when you call pack_fclose_chunk().
Chunks can be nested inside each other by making repeated calls to pack_fopen_chunk(). When writing a file, the compression status is
inherited from the parent file, so you only need to set the pack flag if the parent is not compressed but you want to pack the chunk data.
If the parent file is already open in packed mode, setting the pack flag will result in data being compressed twice: once as it is written
to the chunk, and again as the chunk passes it on to the parent file.
RETURN VALUE
Returns a pointer to the sub-chunked PACKFILE, or NULL if there was some error (eg. you are using a custom PACKFILE vtable).
SEE ALSO
pack_fclose_chunk(3alleg4), pack_fopen(3alleg4)
Allegro version 4.4.2 pack_fopen_chunk(3alleg4)