how do you get to know if the write operation was succesful.


 
Thread Tools Search this Thread
Special Forums IP Networking how do you get to know if the write operation was succesful.
# 1  
Old 07-07-2007
how do you get to know if the write operation was succesful.

how do you get to know if the write operation for writing to a socket was succesful was succesful.
# 2  
Old 07-07-2007
You are supposed to check the return code of the write() system call. It will be -1 if an error occurred. See the man page on the system call for details.
# 3  
Old 07-07-2007
Quote:
Originally Posted by arjunjag
how do you get to know if the write operation for writing to a socket was succesful was succesful.
Answer: return code and errno. If it was zero or less, then the write did not work.

Note, a successful write to a socket does not mean successful reception at the other end. TCP data will be delivered when the network and remote peer permit. Even a zero returned from close() does not indicate if the data was actually transmitted.
# 4  
Old 07-07-2007
The Successful write operation

write system call returs an integer the value of which is number of bytes written. If the sytem call write returns -1 then an error has occured.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Interactive Python 3.5+ sys.stdout.write() AND sys.stderr.write() bug?

(Apologies for any typos.) OSX 10.12.3 AND Windows 10. This is for the serious Python experts on at least 3.5.x and above... In script format sys.stdout.write() AND sys.stderr.write() seems to work correctly. Have I found a serious bug in the interactive sys.stdout.write() AND... (2 Replies)
Discussion started by: wisecracker
2 Replies

2. Shell Programming and Scripting

Is it possible to write write multiple cronjobs in shellscript??

Hi All, I need the answer of below question? 1) How to write multiple cronjobs in shellscript? Is there any way or we cant write in shellscript... Regards, Priyanka (2 Replies)
Discussion started by: pspriyanka
2 Replies

3. Shell Programming and Scripting

Grab data between 2 keywords any do an array operation and write the file intact

Hi Unix Gurus, I need to grep for a block that is between a start and end keyword and then in between I need to find and replace a keyword. for eg: I need to search between Test = 000; and Test = 000; and find K9 and replace with M9 INPUT FILE Define { Replace = K9; Test =... (6 Replies)
Discussion started by: naveen@
6 Replies

4. Shell Programming and Scripting

Transferring file write operation to another host

I have a process running on two hosts in Active/Standby mode. Process running on active machine is handling the traffic while process running on Standby machine is sitting idle. We have a debugging mechanism in which logs are generated on local machine. When logging is enabled then process running... (1 Reply)
Discussion started by: akhilonnet
1 Replies

5. Shell Programming and Scripting

Continously grep a string between <resultmessage> which are not succesful

Hi Gurus, I have XML log files which is continuously updated with resultmessage succesful and which are not successful. My intention is to grep the <resultMessage> which does not contain following success message and put it in a file. <resultCode>0</resultCode> ... (10 Replies)
Discussion started by: thepurple
10 Replies

6. Shell Programming and Scripting

Column operation : cosne and sine operation

I have a txt file with several columns and i want to peform an operation on two columns and output it to a new txt file . file.txt 900.00000 1 1 1 500.00000 500.00000 100000.000 4 4 1.45257346E-07 899.10834 ... (4 Replies)
Discussion started by: shashi792
4 Replies

7. Linux

File read/ write operation

Hi, I am creating a progress bar for file upload for which I have CGI script which copies the data and depending on certain bytes it increments the progress bar. Here, I am writing the incremented value to a file which is read by Ajax at server end. However, here I want to ask that, is it... (18 Replies)
Discussion started by: xs2punit
18 Replies

8. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

9. Solaris

monitoring multipath IO for read and write operation

Hi Folks, I would like to monitor multipath IO on solaris for write and read operations. Does "sar -d" include multipath IO information along with other block devices ? Thanks, Faizan. (0 Replies)
Discussion started by: sifaizan
0 Replies

10. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
Login or Register to Ask a Question