Charles E Campbell Jr wrote:
I've attached a patch to vim 7.1 which extends getfsize(); with the patch, getfsize() takes an optional second parameter which gives one the ability to specify a "unitsize".
Things move quickly here ... I'm still polishing my code. However, I don't think it's going to be quite so easy to patch Vim to handle 64-bit file sizes on 32-bit architectures. On a 32-bit machine, the 'st.st_size' in your code will be a 32-bit integer and so will have the wrong file size. Using gcc, and if supported by the underlying system, it is possible to define an option so st.st_size is 64 bits, but a lot of thought would be needed to take care that the rest of Vim is not adversely affected. A minor point concerns the line: if(stsize*unitsize < st.st_size) ++stsize; On a 32-bit machine, stsize and unitsize will be 32 bits, so the multiply will give a 32-bit answer. If st.st_size were 64 bits, you would need a cast to a 64-bit integer on the left. I will put what I have in a new post. John