Charles E Campbell Jr wrote:
John Beckett wrote:

A.J.Mechelynck wrote:

What about a different function to return, say, the number of
1K blocks (or the number of times 2^n bytes, with a parameter
passed to the function) that a file uses?


Yes, that's a much more general and better idea.

Since there's probably not much need for this, I think that
simplicity would be good. That is, have the function work in a
fixed way with no options.

Re Dr.Chip's LargeFile script: It occurs to me that another
workaround would be to use system() to capture the output of
'ls -l file' or 'dir file' (need an option for which).

Then do some funky editing to calculate the number of digits in
the file length. If more than 9, treat file as large.

I'm playing with a tiny utility to help the LargeFile script.
Bluesky: Its code (64-bit file size) could potentially be
incorporated in Vim. I'll post results in vim-dev.


(I've moved this over to vim-dev)

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". In other words,

getfsize("eval.c")  -> 478347     (after the patch)

getfsize("eval.c",1000)  -> 479   (truncated upwards)

I'll be awaiting Bram's input before making use of this in LargeFile.vim !

Regards,
Chip Campbell




I'm not sure what varnumber_T means: will st.stsize (the dividend) be wide enough to avoid losing bits on the left?


Best regards,
Tony.
--
'I generally avoid temptation unless I can't resist it."
                -- Mae West

Reply via email to