Title
C++0x file positioning should handle modern file sizes
Status
nad
Section
[fpos]
Submitter
Beman Dawes

Created on 2006-04-12.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

[ 2009-07 Frankfurt ]

This is the subject of paper N2926.

If we choose to take any action, we will move the paper, so the issue can be closed.

Move to NAD.

Date: 2010-10-21.18:28:33

[ Kona (2007): We need a paper. It would be nice if someone proposed clarifications to the definitions of pos_type and off_type. Currently these definitions are horrible. Proposed Disposition: Open ]

Date: 2006-04-12.00:00:00

There are two deficiencies related to file sizes:

  1. It doesn't appear that the Standard Library is specified in a way that handles modern file sizes, which are often too large to be represented by an unsigned long.
  2. The std::fpos class does not currently have the ability to set/get file positions.

The Dinkumware implementation of the Standard Library as shipped with the Microsoft compiler copes with these issues by:

  1. Defining fpos_t be long long, which is large enough to represent any file position likely in the foreseeable future.
  2. Adding member functions to class fpos. For example,
    fpos_t seekpos() const;
    

Because there are so many types relating to file positions and offsets (fpos_t, fpos, pos_type, off_type, streamoff, streamsize, streampos, wstreampos, and perhaps more), it is difficult to know if the Dinkumware extensions are sufficient. But they seem a useful starting place for discussions, and they do represent existing practice.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3096
2010-10-21 18:28:33adminsetmessages: + msg3095
2006-04-12 00:00:00admincreate