Displaying 5 results from an estimated 5 matches for "f_tell".
2005 May 19
0
problems with truncate() with files > 2Gb under Windows (PR#7880)
__USE_LARGEFILE is a standard Unix way to allow > 2Gb files on 32-bit
OSes by using f{seek,tell}o Take a look at the definition of f_tell:
#if defined(HAVE_OFF_T) && defined(__USE_LARGEFILE)
#define f_seek fseeko
#define f_tell ftello
#else
#ifdef Win32
#define f_seek fseeko64
#define f_tell ftello64
#else
#define f_seek fseek
#define f_tell ftell
#endif
#endif
Windows support for > 2Gb files seemed flaky, but we did not...
2005 May 19
1
problems with truncate() with files > 2Gb under Windows (possibly (PR#7879)
...urn value from seek() appears to be a 32-bit signed integer,
resulting in strange (incorrect) return values from seek(), though
otherwise not affecting correct operation.
Inspecting the code, I wonder whether the lines
#if defined(HAVE_OFF_T) && defined(__USE_LARGEFILE)
off_t pos = f_tell(fp);
#else
long pos = f_tell(fp);
#endif
in the definition of file_seek() in main/connections.c should be more
along the lines of the code defining struct fileconn in
include/Rconnections.h:
#if defined(HAVE_OFF_T) && defined(__USE_LARGEFILE)
off_t rpos, wpos;
#else
#ifdef Win32...
2007 Aug 27
1
fix for broken largefile seek() on 32-bit linux (PR#9883)
...==
--- src/extra/zlib/gzio.c (revision 42664)
+++ src/extra/zlib/gzio.c (working copy)
@@ -25,7 +25,7 @@
#include "zutil.h"
/* R ADDITION */
-#if defined(HAVE_OFF_T) && defined(HAVE_SEEKO)
+#if defined(HAVE_OFF_T) && defined(HAVE_FSEEKO)
#define f_seek fseeko
#define f_tell ftello
#else
Index: src/include/Rconnections.h
===================================================================
--- src/include/Rconnections.h (revision 42664)
+++ src/include/Rconnections.h (working copy)
@@ -63,7 +63,7 @@
typedef struct fileconn {
FILE *fp;
-#if defined(HAVE_OFF_T) &a...
2005 May 28
1
(PR#7899) seek(con, 0, "end", rw="r") does not always work
...e an fflush() was a guess (hence the question mark,
> but evidence for the guess being correct was that doing a flush at the R
> command line made the whole thing work correctly.) To be safe, I would
> try to put a flush() right at the beginning of file_seek(), before the
> call to f_tell(). I tried this, and with the modification the test case
> I gave produced correct output. Here's how the beginning of my modified
> file_seek() function (in main/connections.c) looks:
>
> static double file_seek(Rconnection con, double where, int origin, int rw)
> {
>...
2005 May 27
0
seek(con, 0, "end", rw="r") does not always work correctly (PR#7901)
...My suggestion to use an fflush() was a guess (hence the question mark,
but evidence for the guess being correct was that doing a flush at the R
command line made the whole thing work correctly.) To be safe, I would
try to put a flush() right at the beginning of file_seek(), before the
call to f_tell(). I tried this, and with the modification the test case
I gave produced correct output. Here's how the beginning of my modified
file_seek() function (in main/connections.c) looks:
static double file_seek(Rconnection con, double where, int origin, int rw)
{
Rfileconn this = con->pr...