09-26-2001
fcntl() can tell you if a open file has read-only, write-only, or read-write access modes set during the open(). It will fail on a closed file.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I believe i have most of samba configured right but i get this error each time time try to run it. I was given suggestion that i touch the file, i did, but i still cannot rid myself of this error.
Any suggestions (2 Replies)
Discussion started by: macdonto
2 Replies
2. UNIX for Dummies Questions & Answers
I have a UNIX daemon process that's been started by a parent process, an application server.
The behavior of this daemon process is to inherit and use the app
server's file descriptors (ports/sockets).
When I shutdown the app server, the daemon continues to run, because there may be other... (1 Reply)
Discussion started by: kunalashar
1 Replies
3. Solaris
Hi
I have a script to remove log files when it reaches %70 usage in order to descending order of dates. But sometimes it happens to remove open - being processes files , so makes them unlinked from the directors and results them disappeared.
How can I solve this problem , simple scenario I... (9 Replies)
Discussion started by: xramm
9 Replies
4. UNIX for Advanced & Expert Users
I am having a client/server application which will download files from server. If server has directories, it will create directories/sub directories and then download files. In this process, I observed that number of open files are more than 400 (which is approxmately same as number of dir/subdir... (1 Reply)
Discussion started by: satyam90
1 Replies
5. Windows & DOS: Issues & Discussions
I'm trying to setup a cron job for my brother that goes out to the web and retrieves an excel file and overwrites the existing copy on his desktop. The problem I'm facing is I have to kill the process (excel.exe) if the file is open while the batch file runs, otherwise, it will create another copy... (2 Replies)
Discussion started by: quattro20v
2 Replies
6. Solaris
Hi
want to know what file (descriptor+filename+socket) is being accessed by particular process on solaris.
Purpose : while running perf. test, needs to find where is the bottleneck.
We are providing concurrnet load for around 1 hr and needs to capture data related to file usage pattern... (1 Reply)
Discussion started by: raxitsheth
1 Replies
7. Shell Programming and Scripting
I write a script which will stop an application, then restart it.
Sometimes it is succesful, sometimes not.
The problem is, when stop the application, some ports are still listenning (or not released). When start the application, it reports that ports are used, and can't continues.
I use... (1 Reply)
Discussion started by: rdcwayx
1 Replies
8. IP Networking
Hi,
I have read some forum theads about the open and close ports. some points are clear and it is not working on my machine or something am i missing?
I have commented out a port /etc/services, one application uses
then when i use the telnet <hostname> <port_blocked> it shows connected..... (1 Reply)
Discussion started by: balamv
1 Replies
9. Shell Programming and Scripting
I would like to create the following script:
run a python script with setsid
python may or may not fail with exception
check if all of the group processes were terminated correctly
if not, kill the remaining processes
How can I do that?
Thanks a lot (3 Replies)
Discussion started by: ASF Studio
3 Replies
10. Shell Programming and Scripting
Hi Gurus,
I have an input like the one below. What i wanted to achieved is to create a select statement based from that information
INPUTInsert into table_name (col1,col2,col3,col4,col5,DATE1,DATE2,col6,col7,col8,col9,col10,col11) values (6752,14932156,24,'ALL','Staff',to_date('04/17/2017... (6 Replies)
Discussion started by: ernesto
6 Replies
PIPE(P) POSIX Programmer's Manual PIPE(P)
NAME
pipe - create an interprocess channel
SYNOPSIS
#include <unistd.h>
int pipe(int fildes[2]);
DESCRIPTION
The pipe() function shall create a pipe and place two file descriptors, one each into the arguments fildes[0] and fildes[1], that refer to
the open file descriptions for the read and write ends of the pipe. Their integer values shall be the two lowest available at the time of
the pipe() call. The O_NONBLOCK and FD_CLOEXEC flags shall be clear on both file descriptors. (The fcntl() function can be used to set both
these flags.)
Data can be written to the file descriptor fildes[1] and read from the file descriptor fildes[0]. A read on the file descriptor fildes[0]
shall access data written to the file descriptor fildes[1] on a first-in-first-out basis. It is unspecified whether fildes[0] is also open
for writing and whether fildes[1] is also open for reading.
A process has the pipe open for reading (correspondingly writing) if it has a file descriptor open that refers to the read end, fildes[0]
(write end, fildes[1]).
Upon successful completion, pipe() shall mark for update the st_atime, st_ctime, and st_mtime fields of the pipe.
RETURN VALUE
Upon successful completion, 0 shall be returned; otherwise, -1 shall be returned and errno set to indicate the error.
ERRORS
The pipe() function shall fail if:
EMFILE More than {OPEN_MAX} minus two file descriptors are already in use by this process.
ENFILE The number of simultaneously open files in the system would exceed a system-imposed limit.
The following sections are informative.
EXAMPLES
None.
APPLICATION USAGE
None.
RATIONALE
The wording carefully avoids using the verb "to open" in order to avoid any implication of use of open(); see also write() .
FUTURE DIRECTIONS
None.
SEE ALSO
fcntl() , read() , write() , the Base Definitions volume of IEEE Std 1003.1-2001, <fcntl.h>, <unistd.h>
COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol-
ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE
and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained
online at http://www.opengroup.org/unix/online.html .
IEEE
/The Open Group 2003 PIPE(P)