Sponsored Content
Special Forums IP Networking how do you get to know if the write operation was succesful. Post 302125762 by Ashvin Gaur on Saturday 7th of July 2007 03:54:59 AM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
WRITE(2)							System Calls Manual							  WRITE(2)

NAME
write - write output SYNOPSIS
#include <sys/types.h> #include <unistd.h> ssize_t write(int d, const void *buf, size_t nbytes) DESCRIPTION
Write attempts to write nbytes of data to the object referenced by the descriptor d from the buffer pointed to by buf. On objects capable of seeking, the write starts at a position given by the pointer associated with d, see lseek(2). Upon return from write, the pointer is incremented by the number of bytes actually written. Objects that are not capable of seeking always write from the current position. The value of the pointer associated with such an object is undefined. When using non-blocking I/O on objects such as TCP/IP channels that are subject to flow control, write may write fewer bytes than requested; the return value must be noted, and the remainder of the operation should be retried when possible. RETURN VALUE
Upon successful completion the number of bytes actually written is returned. Otherwise a -1 is returned and the global variable errno is set to indicate the error. ERRORS
Write will fail and the file pointer will remain unchanged if one or more of the following are true: [EBADF] D is not a valid descriptor open for writing. [EPIPE] An attempt is made to write to a pipe that is not open for reading by any process. [EPIPE] An attempt is made to write to a TCP channel that is not connected to a peer socket. [EFBIG] An attempt was made to write a file that exceeds the process's file size limit or the maximum file size. [EFAULT] Part of the data to be written to the file points outside the process's allocated address space. [ENOSPC] There is no free space remaining on the file system containing the file. [EIO] An I/O error occurred while reading from or writing to the file system. [EAGAIN] The file was marked for non-blocking I/O, and no data could be written immediately. SEE ALSO
fcntl(2), lseek(2), open(2), pipe(2), read(2). 4th Berkeley Distribution May 14, 1986 WRITE(2)
All times are GMT -4. The time now is 10:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy