12-18-2006
Are you doing any error checking for that fopen? After the fopen make sure that you check if fp is being set to NULL. If it is, you can use perror() or errno to check the exact error.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
sometimes I ftp files from an Unix environment from the command prompt of my win2000 pc and I get a "broken pipe" message. sometimes I'll get nothing but sometimes I'll get part of the file.
Whats this "broken pipe" about?? (3 Replies)
Discussion started by: eloquent99
3 Replies
2. UNIX for Advanced & Expert Users
Hi
I tried to open the man page of sh and piped to `pg`. Normally while reading a file page by page using `pg`, if we wanna quit at the middle of file, we give "q" near the colon mode.
Ex1: $cat file1 | pg
hi
how
r
u
: (page1) now press "return key", it will go to next page
yes
i ... (1 Reply)
Discussion started by: ramkrix
1 Replies
3. UNIX for Dummies Questions & Answers
Hi
I tried to open the man page of sh and piped to `pg`. Normally while reading a file page by page using `pg`, if we wanna quit at the middle of file, we give "q" near the colon mode.
Ex1: $cat file1 | pg
hi
how
r
u
: (page1) now press "return key", it will go to next page
yes
i ... (3 Replies)
Discussion started by: ramkrix
3 Replies
4. Linux
hi
i have a server, and i have a web site and i installed apache in the /usr/local/apache/logs
i have a file and i have this problem
(32)Broken pipe: core_output_filter: writing data to the network
plz help me how i can resolve this
plz it's urgent
th (2 Replies)
Discussion started by: abir2
2 Replies
5. Shell Programming and Scripting
Hi All ,
Is there any way to replace the pipe ( | ) with the broken pipe (0xA6) in unix (1 Reply)
Discussion started by: saj
1 Replies
6. UNIX for Dummies Questions & Answers
I know what causes 'broken pipe' errors, but I can't understand why I can get it (only occasionally) with my example:
ps -ef | grep "\./ans$" | grep -v grep
Basically I'm searching the ps output looking for the process I'm interested in and excluding the process that is grepping for the... (2 Replies)
Discussion started by: fhew
2 Replies
7. UNIX for Advanced & Expert Users
The "write failed: Broken pipe" message is reported by the file sending PC which run my writed network device driver while 500MB or 900MB is sended!
What does the message mean? Does this mean there is a bug in my driver?
li,kunlun (11 Replies)
Discussion started by: liklstar
11 Replies
8. Red Hat
Hi all,
I am trying to run a sleep command and I am receiving a broken pipe when I execute. any help would be greatly appreciated.
sleep `< /dev/urandom tr -dc 0-6 | head -c2` (2 Replies)
Discussion started by: gartie
2 Replies
9. Shell Programming and Scripting
Hello,
I am trying to run some code on Matlab over ssh . The code takes around 5-6 hours to complete. so after giving the command to run it , I locked my machine and then went off to sleep at night, only to discover in the morning that I get this message :
...Code running, partial results... (1 Reply)
Discussion started by: ajayram
1 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I am iseries resource and having Issue in one of the sFTP failures between one of my job (Unix --> iSeries).
The response to sending machine (Unix) is "Write Failed Broken Pipe".
Appreciate any help Available on why this Issue happens, how can we replicate the same, what fixes can... (1 Reply)
Discussion started by: hamelchauhan
1 Replies
LEARN ABOUT OPENSOLARIS
fopen
fopen(3UCB) SunOS/BSD Compatibility Library Functions fopen(3UCB)
NAME
fopen, freopen - open a stream
SYNOPSIS
/usr/ucb/cc [ flag ... ] file ...
#include <stdio.h>
FILE *fopen(file, mode)
const char *file, *mode;
FILE *freopen(file, mode, iop)
const char *file, *mode;
register FILE *iop;
DESCRIPTION
The fopen() function opens the file specified by file and associates a stream with it. If the open succeeds, fopen() returns a pointer to
be used to identify the stream in subsequent operations. The file argument points to a character string that contains the name of the file
to be opened. The mode argument is a character string having one of the following values:
r open for reading
w truncate or create for writing
a append: open for writing at end of file, or create for writing
r+ open for update (reading and writing)
w+ truncate or create for update
a+ append; open or create for update at EOF
The freopen() function opens the file specified by file and associates the stream pointed to by iop with it. The mode argument is used just
as in fopen(). The original stream is closed, regardless of whether the open ultimately succeeds. If the open succeeds, freopen() returns
the original value of iop.
The freopen() function is typically used to attach the preopened streams associated withstdin, stdout, and stderr to other files.
When a file is opened for update, both input and output can be performed on the resulting stream. Output cannot be directly followed by
input without an intervening fseek(3C) or rewind(3C). Input cannot be directly followed by output without an intervening fseek(3C) or
rewind(3C). An input operation that encounters EOF will fail.
RETURN VALUES
The fopen() and freopen() functions return a NULL pointer on failure.
USAGE
The fopen() and freopen() functions have transitional interfaces for 64-bit file offsets. See lf64(5).
SEE ALSO
cc(1B), open(2), fclose(3C), fopen(3C), freopen(3C), fseek(3C), malloc(3C), rewind(3C), lf64(5)
NOTES
Use of these functions should be restricted to applications written on BSD platforms. Use of these functions with any of the system
libraries or in multithreaded applications is unsupported.
To support the same number of open files as the system, fopen() must allocate additional memory for data structures using malloc(3C) after
64 files have been opened. This confuses some programs that use their own memory allocators.
The fopen() and freopen() functions differ from the standard I/O functions fopen(3C) and freopen(3C). The standard I/O functions distin-
guish binary from text files with an additional use of 'b' as part of the mode, enabling portability of fopen(3C) and freopen(3C) beyond
SunOS 4.x systems.
SunOS 5.11 30 Oct 2007 fopen(3UCB)