Added file preallocation code