Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #24656

Re: RESIZE-FILE - mistakes ANS made

From "Ed" <invalid@invalid.com>
Newsgroups comp.lang.forth
Subject Re: RESIZE-FILE - mistakes ANS made
Date 2013-07-22 14:39 +1000
Organization Aioe.org NNTP Server
Message-ID <ksicue$4ih$1@speranza.aioe.org> (permalink)
References <ksbh6p$8ug$1@speranza.aioe.org> <e314df9b-6da8-4cc7-adc9-a8e98a811ce4@googlegroups.com>

Show all headers | View raw


m.a.m.hendrix@tue.nl wrote:
> On Friday, July 19, 2013 4:09:24 PM UTC+2, Ed wrote:
> > 3. the position of the file-pointer should be  'ud'  because that's
> >    the point at which one will begin writing new data.
>
> 4. The file-pointer should not change (assuming here that on some
> systems it is more efficient to make room first, then write instead
> of write and see what happens.)

Surely that's *inefficient* and contrary to the concept of 'random
disk access'.

RESIZE-FILE should reflect what's most useful for applications.
Should there be an OS which leaves the file-pointer at the wrong
position, it's no problem for RESIZE-FILE to adjust it.

> ISTR that on MSDOS one could do RESIZE-FILE by writing
> 0 bytes at the new (smaller) EOF (not obvious) or n bytes at
> the old EOF.

Writing 0 bytes can also be used to *extend* the file.  In both cases
one presets the file-pointer the desired position.  After the operation
the file-pointer remains unchanged and represents the new EOF.
For efficiency nothing gets written to the file - only the directory
information is updated.


Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

RESIZE-FILE - mistakes ANS made "Ed" <invalid@invalid.com> - 2013-07-20 00:09 +1000
  Re: RESIZE-FILE - mistakes ANS made m.a.m.hendrix@tue.nl - 2013-07-19 07:55 -0700
    Re: RESIZE-FILE - mistakes ANS made Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-19 22:34 +0200
    Re: RESIZE-FILE - mistakes ANS made "Ed" <invalid@invalid.com> - 2013-07-22 14:39 +1000
      Re: RESIZE-FILE - mistakes ANS made Alex McDonald <blog@rivadpm.com> - 2013-07-21 23:25 -0700
        Re: RESIZE-FILE - mistakes ANS made m.a.m.hendrix@tue.nl - 2013-07-22 01:21 -0700
          Re: RESIZE-FILE - mistakes ANS made Alex McDonald <blog@rivadpm.com> - 2013-07-22 15:00 -0700
          Re: RESIZE-FILE - mistakes ANS made "Ed" <invalid@invalid.com> - 2013-07-29 18:31 +1000
            Re: RESIZE-FILE - mistakes ANS made Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-29 03:36 -0500
              Re: RESIZE-FILE - mistakes ANS made "Ed" <invalid@invalid.com> - 2013-08-01 18:00 +1000
                Re: RESIZE-FILE - mistakes ANS made Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-08-01 03:33 -0500
      Re: RESIZE-FILE - mistakes ANS made m.a.m.hendrix@tue.nl - 2013-07-22 01:20 -0700
        Re: RESIZE-FILE - mistakes ANS made "Ed" <invalid@invalid.com> - 2013-07-24 17:56 +1000
      Re: RESIZE-FILE - mistakes ANS made Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-22 03:49 -0500
  Re: RESIZE-FILE - mistakes ANS made anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-22 11:40 +0000
    Re: RESIZE-FILE - mistakes ANS made "Ed" <invalid@invalid.com> - 2013-07-24 18:04 +1000

csiph-web