Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

zzat(1) [debian man page]

zzat(1) 						      General Commands Manual							   zzat(1)

NAME
zzat - concatenate files using different instruction sequences SYNOPSIS
zzat [-AbdeEntTv] [-r loops] [-x sequence] [FILE]... zzat -l | --list zzat -h | --help zzat -V | --version DESCRIPTION
The zzat utility reads files sequentially, writing them to the standard output. The user can decide which sequence of library calls is used to seek and read data. zzat is primarily used as a debugging tool for zzuf, because it can emulate different programs' ways to read files. OPTIONS
-A, --show-all Equivalent to -vET. -b, --number-nonblank Number nonempty output lines. -d, --debug Output debugging information. -e Equivalent to -vET. -E, --show-ends Display $ at end of each line. -n, --number Number all output lines. -r, --repeat=loops Concatenate all files loops times. -t Equivalent to -vT. -T, --show-tabs Display TAB characters as ^I. -v, --show-nonprinting Use ^ and M- notation, except for LFD and TAB. -x, --execute=sequence Read a file or a stream using the instruction sequence specified in sequence. Instructions are executed sequentially until the end of the program. End-of-file is not an exit condition, except where the feof keyword is used: fread(1,10); feof(1); fread(1,10) Loops are permitted using the repeat keyword. Again, feof can be used to prematurely break out of a loop: repeat(10000, fgetc() feof(1)) Instructions can be separated by spaces, commas or semicolons. A list of all available instructions and control keywords can be obtained using this command: zzat -l If no sequence is specified, the following default sequence is used: repeat(-1, fread(1,32768), feof(1)) -l, --list Display the list of supported keywords and functions and exit. -h, --help Display a short help message and exit. -V, --version Output version information and exit. EXAMPLES
Read the first 1000 bytes of f, then exit: zzat -x 'fread(1,1000)' f Read the first four bytes of f, using four different instructions: zzat -x 'getc(),fgetc(),getc_unlocked(),_IO_getc()' f Read f entirely, by calling getc() repeatedly until end-of-file is reached: zzat -x 'repeat(-1, getc(), feof(1))' f Read f entirely, in chunks of 32768 bytes until end-of-file is reached: zzat -x 'repeat(-1, fread(1,32768), feof(1))' f SEE ALSO
zzuf(3), libzzuf(3) AUTHOR
Copyright (C) 2002-2010 Sam Hocevar <sam@hocevar.net>. zzat and this manual page are free software. They come without any warranty, to the extent permitted by applicable law. You can redis- tribute them and/or modify them under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. zzuf's webpage can be found at http://caca.zoy.org/wiki/zzuf. An overview of the architecture and inner works is at http://caca.zoy.org/wiki/zzuf/internals. zzat 0.13 2010-01-07 zzat(1)

Check Out this Related Man Page

fread(3C)						   Standard C Library Functions 						 fread(3C)

NAME
fread - binary input SYNOPSIS
#include <stdio.h> size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream); DESCRIPTION
The fread() function reads into the array pointed to by ptr up to nitems elements whose size is specified by size in bytes, from the stream pointed to by stream. For each object, size calls are made to the fgetc(3C) function and the results stored, in the order read, in an array of unsigned char exactly overlaying the object. The file-position indicator for the stream (if defined) is advanced by the number of bytes successfully read. If an error occurs, the resulting value of the file-position indicator for the stream is unspecified. If a partial ele- ment is read, its value is unspecified. The fread() function may mark the st_atime field of the file associated with stream for update. The st_atime field will be marked for update by the first successful execution of fgetc(3C), fgets(3C), fgetwc(3C), fgetws(3C), fread(), fscanf(3C), getc(3C), getchar(3C), gets(3C), or scanf(3C) using stream that returns data not supplied by a prior call to ungetc(3C) or ungetwc(3C). RETURN VALUES
Upon successful completion, fread() returns the number of elements successfully read, which is less than nitems only if a read error or end-of-file is encountered. If size or nitems is 0, fread() returns 0 and the contents of the array and the state of the stream remain unchanged. Otherwise, if a read error occurs, the error indicator for the stream is set and errno is set to indicate the error. ERRORS
Refer to fgetc(3C). EXAMPLES
Example 1: Reading from a Stream The following example reads a single element from the fp stream into the array pointed to by buf. #include <stdio.h> ... size_t bytes_read; char buf[100]; FILE *fp; ... bytes_read = fread(buf, sizeof(buf), 1, fp); ... USAGE
The ferror() or feof() functions must be used to distinguish between an error condition and end-of-file condition. See ferror(3C). Because of possible differences in element length and byte ordering, files written using fwrite(3C) are application-dependent, and possibly cannot be read using fread() by a different application or by the same application on a different processor. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
read(2), fclose(3C), ferror(3C), fopen(3C), getc(3C), gets(3C), printf(3C), putc(3C), puts(3C), attributes(5), standards(5) SunOS 5.10 24 Jul 2002 fread(3C)
Man Page