iob_write(3) Library Functions Manual iob_write(3)NAME
iob_write - send I/O batch through callback
typedef int64 (*io_write_callback)(int64 s,const void* buf,uint64 n);
int64 iob_write(int64 s,io_batch* b,io_write_callback cb);
iob_write sends the (rest of) b through the callback cb, passing s as first argument. cb is expected to behave like io_trywrite(2).
This interface is intended to send an I/O batch through a filter, for example to encrypt or compress it. If you just want to send an I/O
batch to a socket, use iob_send instead.
iob_write returns the number of bytes written, 0 if there were no more bytes to be written in the batch, -1 for EAGAIN, or -3 for a perma-
nent error (for example "connection reset by peer").
The normal usage pattern is using io_wait to know when a descriptor is writable, and then calling iob_write until it returns 0, -1 or -3.
If it returns 0, terminate the loop (everything was written OK). If it returns -1, call io_wait again. If it returned -3, signal an
iob_write will continue to call your callback until it returns an error. So if you are in a state machine, for example a web server using
this for SSL support, make sure to write at most n bytes at a time (e.g. 64k) and the next time you are called return -1. Otherwise
iob_write might not return until the whole file is served.
SEE ALSO iob_send(3)iob_write(3)
Check Out this Related Man Page
io_tryread(3) Library Functions Manual io_tryread(3)NAME
io_tryread - read from a descriptor without blocking
int io_tryread(int64 fd,char* buf,int64 len);
io_tryread tries to read len bytes of data from descriptor fd into buf, buf, ..., buf[len-1]. (The effects are undefined if len is 0
or smaller.) There are several possible results:
o o_tryread returns an integer between 1 and len: This number of bytes was available for immediate reading; the bytes were read into the
beginning of buf. Note that this number can be, and often is, smaller than len; you must not assume that io_tryread always succeeds in
reading exactly len bytes.
o io_tryread returns 0: No bytes were read, because the descriptor is at end of file. For example, this descriptor has reached the end of
a disk file, or is reading an empty pipe that has been closed by all writers.
o io_tryread returns -1, setting errno to EAGAIN: No bytes were read, because the descriptor is not ready. For example, the descriptor is
reading an empty pipe that could still be written to.
o io_tryread returns -3, setting errno to something other than EAGAIN: No bytes were read, because the read attempt encountered a persis-
tent error, such as a serious disk failure (EIO), an unreachable network (ENETUNREACH), or an invalid descriptor number (EBADF).
io_tryread does not pause waiting for a descriptor that is not ready. If you want to pause, use io_waitread or io_wait.
You can make io_tryread faster and more efficient by making the socket non-blocking with io_nonblock().
SEE ALSO io_nonblock(3), io_waitread(3), io_tryreadtimeout(3)io_tryread(3)
I'm very new to unix and for the most part make my way around but I need to know how to create a batch file that can be ran at scheduled time. The main function of the file will be to copy files to different locations then FTP to a different server. Please help. I you have an example that would be... (2 Replies)
what is a command to call a batch file from a c++ program
when called with the argument which is a text file, then how to print that text file on a printer.
please help me with code if possible (3 Replies)
I have a batch file that takes 2 parameters--source file location and target file location.
I want to create another batch file that contains all the commands with the file locations so that I dont have to enter the ifnromation every time individually.
to execute command
com1.bat... (3 Replies)
I am new to unix shell scripting and I am trying to append batch number that comes in Trailer record to the detailed record.
TR|20080313|22897 ... (6 Replies)
Please assist with awk scirpts:
I need to remove items from a file in a batch:
The file that I will remove from has the following format:
I have a file which... (5 Replies)
I am working on Sun solaris. I would like to know that ,do we any way to
create unique batch in shell scripts.Basically i want to create a batch and want to create a sequence to process the records.
gehlnar (3 Replies)
Hello, this is my first post and i hope you can solve my problem.
I need to create a batch file that will copy folder from hard drive on to usb stick on daily basis.
Can you help me and write that file and explaine me what to do next.
Folder's location is: c\windows\desktop\2009
Thank... (5 Replies)
Recently my project needs int64 variables. However my os and computer are both 32bits.
So how can i use int64 as a parameter in a function.
and is int64 a structure as user-defined structures.....
i am waiting for ur answer:rolleyes: (2 Replies)
I'm writing an batch file to create report
In the batch file iam passing two arguments:startdate and finishdate
Ex: startdate=07-sep-2009 finishdate=07-sep-2011
I need to have script that takes command line argument as input and gives me out currentdate last year and current date... (2 Replies)
Could some one please help to order the batch number in sequence.
I will be getting bunch of files with batch number in folder1 which are not in sequence.
I need to move all files from folder1 to folder2 with batch number in sequence.
Header record looks like
PROCESS1... (8 Replies)
I am trying to create a bat file with the below piece of code.
plink.exe -l username -pw password -P 22 -2 -ssh servername
sudo su - devuser
echo 3 | ./Script.sh
It executes only the first line and not the rest of the lines.
Can you please help me where am I doing wrong? (5 Replies)
I want to create a batch file so the sh file could change a file on a specific time.
I made this config:
sed -i 's/range 192.168.1.200 192.168.1.220;/option POLYCOM "tftp://10.20.1.10";/g' /etc/dhcp3/dhcpd.conf
My issue is that the sed does not accept the :// character.... (2 Replies)
I have to encrypt data using a script in batch mode without being prompted. I can successfully encrypt data but it prompts me to enter (y/N) as shown below. I tried batch flags without no success. I need to automate this without any prompts. Appreciate your inputs.
$... (2 Replies)
In the below perl executes if one file is processed perfect. However, when multiple files are processed in batch which is preferred I get the below error that I can not seem to fix it as the '' necessary for the command to execute, but seem to only work for one -arg option. Thank you :).
... (2 Replies)