On Sat, 15 Jan 2005, Shachar Shemesh wrote:
> I'm trying to make sure a program I'm writing works with files greater
> than 4GB in length. In order to do that, I'm trying to create a sparse
> file of this size. The program is this:
> #define _LARGEFILE64_SOURCE
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <unistd.h>
> #include <fcntl.h>
>
> int main(int argc, char *argv[] )
> {
> int fd=open(argv[1], O_CREAT|O_WRONLY, 0755);
you need to add 'O_LARGEFILE' to the flags of 'open'.
if you search for EFBIG in the sources of your file system, you'll see
this instantly.
--
guy
"For world domination - press 1,
or dial 0, and please hold, for the creator." -- nob o. dy
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]