fixed 4s-dump script to support large datasets with dumping directly to a
file