# Write file with binary mode on linux

**URL:** <https://www.ruby-forum.com/t/write-file-with-binary-mode-on-linux/133572>\
**Category:** Rails\
**Created:** [April 1, 2008, 7:33pm UTC](https://www.ruby-forum.com/t/write-file-with-binary-mode-on-linux/133572 "2008-04-01T19:33:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shafi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@shafi](https://www.ruby-forum.com/u/shafi)\
**Post date:** [April 1, 2008, 7:33pm UTC](https://www.ruby-forum.com/t/write-file-with-binary-mode-on-linux/133572/1 "2008-04-01T19:33:45Z")

</div>

Hello,

I wanna write files on Linux platform but with binary mode.  
On windows we use “wb” but on Linux what do we have to do?

Thanks.

---

<div class="post-metadata">

**Author:** ![shafi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@shafi](https://www.ruby-forum.com/u/shafi)\
**Post date:** [April 1, 2008, 7:40pm UTC](https://www.ruby-forum.com/t/write-file-with-binary-mode-on-linux/133572/2 "2008-04-01T19:40:36Z")

</div>

On 1 Apr 2008, at 18:33, Mohamed S. wrote:

> Hello,
> 
> I wanna write files on Linux platform but with binary mode.  
> On windows we use “wb” but on Linux what do we have to do?

This a pure ruby question, but iirc these days the binary flag does  
nothing on linux: there is no binary/text mode distinction  
Fred
