From: Erik Veenstra Date: 2007-01-08T19:00:31+09:00 Subject: Re: SparseFile > unless data.count("\0") == data.size OK. I experimented with this as well: i = data.index(/[^\000]/) if i @file.pos = @pos + i @file.write(data.gsub(/^\000*|\000*$/, "")) end In theory, it could give better results. But, of course, it is definitely slower: 10.6 seconds instead of 9.5 seconds for one particular test. I'll stick to "unless data.count("\0") == data.size". gegroet, Erik V. - http://www.erikveen.dds.nl/