fopen, open & binary mode
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > fopen, open & binary mode




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    fopen, open & binary mode  
Alex Vinokur


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-04 09:34 AM

fopen() accept binary modes "rb", "wb", ...
Does open() have similar thing?

For instance, http://www.scit.wlv.ac.uk/cgi-bin/mansec?2+open doesn't contai
n "binary".

--
Alex Vinokur
mailto:alexvn@connect.to
http://mathforum.org/library/view/10978.html








[ Post a follow-up to this message ]



    Re: fopen, open & binary mode  
Villy Kruse


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-04 09:34 AM

On Tue, 20 Apr 2004 10:46:06 +0300,
Alex Vinokur <alexvn@big.foot.com> wrote:


> fopen() accept binary modes "rb", "wb", ...
> Does open() have similar thing?
>
> For instance, http://www.scit.wlv.ac.uk/cgi-bin/mansec?2+open doesn't cont
ain "binary".
>


Old C compilers for MSDOS used to support a O_BINARY flag for the open() cal
l.


Villy





[ Post a follow-up to this message ]



    Re: fopen, open & binary mode  
Chuck Dillon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-04 05:35 PM

Alex Vinokur wrote:
> fopen() accept binary modes "rb", "wb", ...
> Does open() have similar thing?

The "b" support is for strict compliance to ISO C.  On UNIX it has *no
effect*.  Your fopen man page should make those points. If such a mode
existed for open() it also would have no effect.

-- ced

>
> For instance, http://www.scit.wlv.ac.uk/cgi-bin/mansec?2+open doesn't cont
ain "binary".
>
> --
>    Alex Vinokur
>      mailto:alexvn@connect.to
>      http://mathforum.org/library/view/10978.html
>
>
>


--
Chuck Dillon
Senior Software Engineer
NimbleGen Systems Inc.





[ Post a follow-up to this message ]



    Re: fopen, open & binary mode  
Alex Vinokur


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-04 05:35 PM


"Chuck Dillon" <cdillon@nimblegen.com> wrote in message news:c6389q$2q4$1@grandcanyon.binc.n
et...
> Alex Vinokur wrote: 
>
> The "b" support is for strict compliance to ISO C.  On UNIX it has *no
> effect*.  Your fopen man page should make those points.

I have tested than on Cygwin (Cygwin is a Linux-like environment for Windows
).
Fo Cygwin a binary mode essentially improves performance.

http://article.gmane.org/gmane.comp...+.perfometer/45 (Raw run log)
http://article.gmane.org/gmane.comp...+.perfometer/44 (Source)

I don't know if it is truth for "pure" UNIX (not on Windows).

[snip]

--
Alex Vinokur
mailto:alexvn@connect.to
http://mathforum.org/library/view/10978.html











[ Post a follow-up to this message ]



    Re: fopen, open & binary mode  
Villy Kruse


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-04 05:35 PM

On Tue, 20 Apr 2004 16:44:50 +0300,
Alex Vinokur <alexvn@big.foot.com> wrote:


>
> I have tested than on Cygwin (Cygwin is a Linux-like environment for Windo
ws).
> Fo Cygwin a binary mode essentially improves performance.
>

That is expected considering that when reading a text file every occurence
of CRLF pairs must be replaced by a single \n character before representing
the data to the user program.

>
> I don't know if it is truth for "pure" UNIX (not on Windows).
>

In pure unix there is no difference between binary and text file and
therefore no proformance difference either.



Villy





[ Post a follow-up to this message ]



    Re: fopen, open & binary mode  
Mac


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-22-04 05:34 AM

On Tue, 20 Apr 2004 16:44:50 +0300, Alex Vinokur wrote:

>
> "Chuck Dillon" <cdillon@nimblegen.com> wrote in message news:c6389q$2q4$1@
grandcanyon.binc.net... 
>
> I have tested than on Cygwin (Cygwin is a Linux-like environment for Windo
ws).
> Fo Cygwin a binary mode essentially improves performance.
>
> http://article.gmane.org/gmane.comp...+.perfometer/45 (Raw run log)
> http://article.gmane.org/gmane.comp...+.perfometer/44 (Source)
>
> I don't know if it is truth for "pure" UNIX (not on Windows).
>
> [snip]
>
> --
>    Alex Vinokur
>      mailto:alexvn@connect.to
>      http://mathforum.org/library/view/10978.html

Be careful, because in cygwin, you can mount paths in a binary mode or a
text mode. Then when you open files, you can use binary or text. It can
all be rather confusing.

--Mac






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:40 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register