> How does one determine the eof when using sysread. The example below > seems to indicate that using #eof? corrupts the file pointer. > > buff_size = File.stat(ARGV[0]).blksize > File.open(ARGV[0]) { |f| > # until f.eof? ## this statement corrupts f > buff = f.sysread(buff_size) > print buff > # end > } file = '/etc/passwd' File.open(file) do |f| begin buff_size = f.stat.blksize while buff = f.sysread(buff_size) print buff end rescue EOFError # done reading end end -sc -- Sean Chittenden