R
RBCC
How do I modify a record in a textfile in vb? Do I need 2 files?
JOhn
JOhn
How do I modify a record in a textfile in vb? Do I need 2 files?
* "Cor said:
* "Cor said:Did I forget again something?
I thougth one file to read the data and one file to write the changed data
back.
Why not write the data back to the same file?
Cor said:Hi Herfried,
I am glad I can teach you something,
That is something you never should do.
You cannot prevent that by example on an unwanted moment the power
goes down.
So with streaming operations it has for me always to be.
Read file
Write file to tempfilename
delete inputfile
rename tempfilename to original name
Or any other save sequence of this.
* "Cor said:I am glad I can teach you something,
That is something you never should do.
You cannot prevent that by example on an unwanted moment the power goes
down.
So with streaming operations it has for me always to be.
Read file
Write file to tempfilename
delete inputfile
rename tempfilename to original name
Still it are two files and I said any other save sequence so there cannot beNo! This will change the creation timestamp of the file. Better:
Read File
Write File to Tempfile
Overwrite File with Tempfile
Delete Tempfile
Cor said:And what is your advice if I want to change the creation timestamp
because I find every change of a txtfile a creation?
* "Cor said:And what is your advice if I want to change the creation timestamp because I
find every change of a txtfile a creation?
* "Armin Zingler said:change <> creation
(IMO)
* "Cor said:Was a big travel to find something to answer.
I first had the historie from dataprocessing but that is to simple to give
an answer for you both while I become than in a corner where it is hard to
fight back..
I thought about this.
Changed means that things stay the same.
Although this is on disk and not on memory this is for me the same as
datafile as new datafile
And not
Datafile = olddatafile
And therefore I think it is newcreated.
As I said I had made more messages about this and one was about a database.If you change a record in a 2 GB database, do you really think the
database should be completely recreated?
* "Cor said:A database is updated by updates, inserts and deletes, never by New, so you
give exactly the answer that you agree with me, things like databases have
creation and change dates. New files should be treathen as always new
created.