Hi Bram,
2016/7/2 Sat 0:18:22 UTC+9 Bram Moolenaar wrote:
> Patch 7.4.1975
> Problem: On MS-Windows large files (> 2Gbyte) cause problems.
> Solution: Use "off_T" instead of "off_t". Use "stat_T" instead of "struct
> stat". Use 64 bit system functions if available. (Ken Takata)
> Files: src/Makefile, src/buffer.c, src/diff.c, src/eval.c, src/ex_cmds.c,
> src/ex_cmds2.c, src/fileio.c, src/gui.c, src/gui_at_fs.c,
> src/if_cscope.c, src/main.c, src/memfile.c, src/memline.c,
> src/misc1.c, src/misc2.c, src/netbeans.c, src/os_mswin.c,
> src/os_win32.c, src/proto/fileio.pro, src/proto/memline.pro,
> src/proto/os_mswin.pro, src/pty.c, src/quickfix.c, src/spell.c,
> src/structs.h, src/tag.c, src/testdir/Make_all.mak,
> src/testdir/test_largefile.vim, src/testdir/test_stat.vim,
> src/undo.c, src/vim.h
Sorry, I forgot to remove Xlarge.txt after the test. (It was useful when I debug
these patches, but it is not needed now.)
And now we have the num64 feature, we can use the number 4000000000 directly
in test_largefile.vim for checking the filesize.
(Or, is it better to check more large file (> 2^32 bytes)?)
Please check the attached patch.
Regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent 195bf71989ccd31be01935b779ce286ac796772c
diff --git a/src/testdir/test_largefile.vim b/src/testdir/test_largefile.vim
--- a/src/testdir/test_largefile.vim
+++ b/src/testdir/test_largefile.vim
@@ -22,9 +22,13 @@ func Test_largefile()
normal 50%
normal gg
w
- " Check if the file size is larger than 2^31 - 1 bytes.
- " Note that getfsize() returns -2 if a Number is 32 bits.
+ " Check if the file size is 4,000,000,000 bytes.
let fsize=getfsize(fname)
- call assert_true(fsize > 2147483647 || fsize == -2)
- "call delete(fname)
+ if has('num64')
+ call assert_true(fsize == 4000000000)
+ else
+ " getfsize() returns -2 if a Number is 32 bits.
+ call assert_true(fsize == -2)
+ endif
+ call delete(fname)
endfunc