From: Nobuyoshi Nakada Date: 2007-07-31T04:43:22+09:00 Subject: Re: size change after file writing Hi, At Tue, 31 Jul 2007 03:50:24 +0900, Li Chen wrote in [ruby-talk:262503]: > I write a small script to read old files and write to new files. Either > reading line by line or whole file at once then I ask Ruby to write to > new files. The new file is much smaller than the old one. I also find > that the new file losses many information. How to explain this? Use "rb" and "wb" mode for binary files, or better, use FileUtils.cp. -- Nobu Nakada