Martin Toft wrote:
>> Vim needs to be able to detect large files (>2GB) on 32-bit
>> systems that have large file support!
>
> Hehe, that sounds pretty complex and extensive.
FYI (and in case it catches anyone's interest here), the code is
very easy.
The trick would be to put the code into the complex Vim
distribution without breaking stuff.
Here is a quick sample of how to get the size of a large file
(>2GB) on a 32-bit system that supports large files. The trick
would be to handle systems that do NOT support large files.
#if defined(__linux)
# define _LARGEFILE64_SOURCE
#elif defined(_WIN32)
# define off64_t __int64
# define stat64 _stati64
#else
/* ??? */
#endif
#include <sys/types.h>
#include <sys/stat.h>
int main(int argc, char *argv[])
{
off64_t size;
struct stat64 sb;
if ( argc != 2 || stat64(argv[1], &sb) != 0 )
return 1;
size = sb.st_size >> 20; /* size in megabytes */
return (int)size;
}
I'm not suggesting you take this on ... sticking to your
schedule would be best. But others here might want to have a
look at it because the current situation is that Dr.Chip has a
great plugin to make Vim handle large files gracefully, but it
can't actually detect really large files...
We were discussing this when the old mailing list broke.
John
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---