Skip to content
Snippets Groups Projects
Commit 8632e81a authored by rswindell's avatar rswindell
Browse files

Revert flength() to returning a 32-bit value unless XPDEV_LARGE_FILE_SUPPORT

is defined.
parent 01a0df86
No related branches found
No related tags found
No related merge requests found
......@@ -390,7 +390,7 @@ int DLLCALL setfdate(const char* filename, time_t t)
/* Returns the length of the file in 'filename' */
/* or -1 if the file doesn't exist */
/****************************************************************************/
int64_t DLLCALL flength(const char *filename)
filelen_t DLLCALL flength(const char *filename)
{
#if defined(__BORLANDC__) && !defined(__unix__) /* stat() doesn't work right */
......@@ -409,20 +409,12 @@ int64_t DLLCALL flength(const char *filename)
#else
#ifdef _WIN32
struct _stati64 st;
#else
struct stat st;
#endif
if(access(filename,0)==-1)
return(-1);
#ifdef _WIN32
if(_stati64(filename, &st)!=0)
#else
if(stat(filename, &st)!=0)
#endif
return(-1);
return(st.st_size);
......
......@@ -218,7 +218,7 @@ extern "C" {
/* General file system wrappers for all platforms and compilers */
DLLEXPORT BOOL DLLCALL fexist(const char *filespec);
DLLEXPORT BOOL DLLCALL fexistcase(char *filespec); /* fixes upr/lwr case fname */
DLLEXPORT int64_t DLLCALL flength(const char *filename);
DLLEXPORT filelen_t DLLCALL flength(const char *filename);
DLLEXPORT time_t DLLCALL fdate(const char *filename);
DLLEXPORT int DLLCALL setfdate(const char* filename, time_t t);
DLLEXPORT BOOL DLLCALL isdir(const char *filename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment