cURL / Mailing Lists / curl-library / Single Mail

curl-library

struct_stat

From: Prashant R <ramapra_at_gmail.com>
Date: Mon, 14 Feb 2011 13:04:50 -0800

Hi ,

I am working on porting liburl for an embedded system that does not support
unix stat function .

I am unable to compile Formdata.c due to the following

static CURLcode AddFormData(struct FormData **formp,

                            enum formtype type,

                            const void *line,

                            size_t length,

                            curl_off_t *size)

{

  ...

  if(size) {

    if(type != FORM_FILE)

      /* for static content as well as callback data we add the size given

         as input argument */

      *size += length;

    else {

      /* Since this is a file to be uploaded here, add the size of the
actual

         file */

      if(!strequal("-", newform->line)) {

        struct_stat file;

        if(!stat(newform->line, &file)) {

          *size += file.st_size;

        }

      }

    }

  }

  return CURLE_OK;

}

The struct stat is undefined for my platform as I have not defined .
struct_stat is defined as

#ifndef struct_stat

# define struct_stat struct stat

#endif

Also HAVE_SYS_STAT_H has not been set for my platform .

I do not plan on using the functionality for using file data . Any ideas on
resolving this ?

Thanks

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-14