Solved

Untyped files in Delphi

Posted on 1998-10-28
2
353 Views
Last Modified: 2011-08-18
Why can't I append to an untyped file ??
Is it ilegal ??  perhaps I can only append to a textfile ??
0
Comment
Question by:Jeb
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
jecksom earned 10 total points
ID: 1344735
Hi Jeb!

just seek to end of file:

procedure TForm1.Button1Click(Sender: TObject);
var f:file;
re:string;
begin
re:=#13+#10+'rem appended'+#13+#10;
assignfile(f,'c:\autoexec.bat');reset(f,1);
seek(f,sizeof(f));
blockwrite(f,re[1],length(re)-1);
closefile(f);
end;

Jecksom

0
 
LVL 1

Expert Comment

by:jecksom
ID: 1344736
PS : there is always more advanced variants (sharing checking,file exist? , etc).

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 89
Dev Express grid collapse 2 44
How to renew a Delphi rad-studio licence? 5 64
TServerSocket - file via sendbuf or Text via sendtext ? 1 53
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question