# Re: tempfile should be binary by default, or at least a flag

**URL:** <https://www.ruby-forum.com/t/re-tempfile-should-be-binary-by-default-or-at-least-a-flag/65950>\
**Category:** Ruby\
**Created:** [August 22, 2006, 4:44pm UTC](https://www.ruby-forum.com/t/re-tempfile-should-be-binary-by-default-or-at-least-a-flag/65950 "2006-08-22T16:44:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [August 22, 2006, 4:44pm UTC](https://www.ruby-forum.com/t/re-tempfile-should-be-binary-by-default-or-at-least-a-flag/65950/1 "2006-08-22T16:44:33Z")

</div>

> One can of course call .binmode immediately after creating  
> the tempfile, but doesn’t binary by default make more sense  
> in the case of a temporary  
> file?
> 
> If it’s too late to change the default behaviour, then perhaps  
> tempfile.new should accept a flag parameter?

This and IO.readlines both. 🙂

Regards,

Dan

This communication is the property of Qwest and may contain confidential  
or  
privileged information. Unauthorized use of this communication is  
strictly  
prohibited and may be unlawful. If you have received this communication  
in error, please immediately notify the sender by reply e-mail and  
destroy  
all copies of the communication and any attachments.
