cURL / Mailing Lists / curl-users / Single Mail

curl-users

ftruncate() on Windows?

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 28 Oct 2004 09:30:56 +0200 (CEST)

Hi

It seems ftruncate() is not available on Windows, and thus my new --retry code
make the Windows build fail.

Does anyone know what alternative function I can use on Windows?

--- snip ---
NAME
        truncate, ftruncate - truncate a file to a specified length

SYNOPSIS
        #include <unistd.h>
        #include <sys/types.h>

        int truncate(const char *path, off_t length);
        int ftruncate(int fd, off_t length);

DESCRIPTION
        The truncate and ftruncate functions cause the regular file named by
        path or referenced by fd to be truncated to a size of precisely length
        bytes.
--- snip ---

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-10-28