octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #66399] fseek and ftell functions don't always


From: Paul Eggert
Subject: [Octave-bug-tracker] [bug #66399] fseek and ftell functions don't always work correctly on Win11 with filesizes >2GB
Date: Tue, 12 Nov 2024 14:15:45 -0500 (EST)

Follow-up Comment #13, bug #66399 (group octave):


> Should we also avoid to use `fseek` with pipes?

C code should avoid fseek; always use fseeko. Although fseek should work with
small-enough offsets why ask for trouble?

If you use fseeko on a pipe, it should either work (if it's a small seek that
stays within the I/O buffer) or fail with errno=ESPIPE; it can also fail for
other reasons.

I don't know about std::fseeko, as I don't use C++. However, Gnulib does
attempt to make its fseeko replacement visible to C++ using the usual
namespace rules. Perhaps this is relevant to your problem, but you'll need a
C++ expert to diagnose it.

I see that you do appear to be trying to work around the issue with
octave_fseeko_wrapper, which I don't fully understand. If you have that, why
use std::fseek in libinterp/corefcn/gl2ps-print.cc? Shouldn't that code use
octave_lseeko_wrapper instead?

Bruno Haible knows C++ and MS-Windows (I know neither), and I hope he'll reply
again on bug-gnulib and clear up some of the confusion here.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66399>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]