06-30-2005
smart question
eg. : there is a file - 322 bytes,
how can I (or you) view just a half of file (161 bytes)?
4 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
hello
My question is whats the difference between LP and LPR to print Sun Solaris ?
lp -dprintername postscriptfile.ps
or
lpr -Pprintname postscriptfile.ps (2 Replies)
Discussion started by: Peterh
2 Replies
2. Shell Programming and Scripting
First, I know that's a bad title. I couldn't think of anything short enough. ...
I wrote the following script to let me know when various parts of the network are down. It used to look like this before last weekend when I got over 500 emails about 1 host being down all weekend:
this is in the... (1 Reply)
Discussion started by: raidzero
1 Replies
3. UNIX for Dummies Questions & Answers
Is it possible for both commands to work? (1 Reply)
Discussion started by: phunkypants
1 Replies
4. Shell Programming and Scripting
Hi,
I need a script to assign variables the below paths
/appl/user_projects/domains/<xxx>/servers/<yyy>/logs
Where <xxx> can be any number and name of directories.
<yyy> can be another set of any number of names and directories.
I want to neglect all the <xxx> and <yyy>... (3 Replies)
Discussion started by: mohtashims
3 Replies
READ(2) System Calls Manual READ(2)
NAME
read, readn, write - read or write file
SYNOPSIS
#include <u.h>
#include <libc.h>
long read(int fd, void *buf, long nbytes)
long readn(int fd, void *buf, long nbytes)
long write(int fd, void *buf, long nbytes)
DESCRIPTION
Read reads nbytes bytes of data from the offset in the file associated with fd into memory at buf. The offset is advanced by the number of
bytes read. It is not guaranteed that all nbytes bytes will be read; for example if the file refers to the console, at most one line will
be returned. In any event the number of characters read is returned. A return value of 0 is conventionally interpreted as end of file.
Readn is just like read, but does successive read calls until nbytes have been read, or a read system call returns a non-positive count.
Write writes nbytes bytes of data starting at buf to the file associated with fd at the file offset. The offset is advanced by the number
of bytes written. The number of characters actually written is returned. It should be regarded as an error if this is not the same as
requested.
SOURCE
/sys/src/libc/9syscall
/sys/src/libc/port/readn.c
SEE ALSO
intro(2), open(2), dup(2), pipe(2)
DIAGNOSTICS
These functions set errstr.
READ(2)