Re: Append text to top of file with VB 6.0?

From: Jonathan Wood (jwood_at_softcircuits.com)
Date: 07/28/04


Date: Wed, 28 Jul 2004 14:14:39 -0600

There is no other way. The system does not allow you to rearrange file data
on the disk. You can read and write, extend, and truncate, and that's it.

I've written software that uses linked lists of data arranged throughout the
file. The application that does this, in effect, allows the user to insert
data items at the top of the file. I can offer thoughts on ways to do this.
But display of the data is controlled by the program. If you want to produce
a regular text file that can be read by other programs, you'll need to write
the file exactly as you want it to appear.

-- 
Jonathan Wood
SoftCircuits
http://www.softcircuits.com
Available for consulting: http://www.softcircuits.com/jwood/resume.htm
"Ron" <bapa118@online.nospam> wrote in message
news:33D02D49-6B8C-481A-B521-AF1409666898@microsoft.com...
> Thanks for the answer.  I already knew that way of doing it.  If by any
chance someone knows another way, please let me know.
>
> thanks.
>
> "Karl E. Peterson" wrote:
>
> > Ron wrote:
> > > Does anyone know of a way to append text to the top of a text file
> > > with VB?  I need to append one full line with a CR LF and sometimes
> > > the file I am appending to can be rather large (over 10 gb).
> >
> > The only way is to write the new line, read the old file, write it.
> >
> > IOW, you're screwed.
> >
> > At least in Win32.  Maybe in Win64 -- with another language?
> > -- 
> > [Microsoft Basic: 1976-2001, RIP]
> >
> >
> >


Relevant Pages

  • Re: Insert Row Condition
    ... Actually Ron scatch the append needs if the following can be done I only ... now that I have each file separated by the blank row is sort the file by the ... city name which is in column I of the first row of each file which is the ...
    (microsoft.public.excel.programming)
  • Re: Insert Row Condition
    ... > Actually Ron scatch the append needs if the following can be done I only wanted to do the append thing to make sorting easy. ... James ... Dim Firstrow As Long ...
    (microsoft.public.excel.programming)
  • Re: Newbie: adding string values to a list?
    ... L.extend(iterable) -- extend list by appending elements from the ... so the extend method will append the individual characters. ...
    (comp.lang.python)
  • Re: list-like behaviour of etree.Element
    ... list-like methods: append, insert, remove. ... Any special reason why it ... doesn't support pop and extend? ...
    (comp.lang.python)
  • Re: How to append existing series?
    ... Or you can use named formulas for series a la ... Dynamic Charts ... > I want to append specific series on a chart. ... > I want to be able to extend specific series so SeriesCollection.Extend, ...
    (microsoft.public.excel.charting)