[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Delphi Programming question

Posted on 1997-07-28
2
Medium Priority
?
142 Views
Last Modified: 2010-04-04
I have created a text file on F: the lan drive. Everynight I have to run a program which should rewrite this file. I do not have delete access on F: I can however erase the contents of the file, with which I am not having any luck. If I use reset procedure, the file is put in read-only mode. If I use append it is write only but I cannot loop until Bof to whitespace the previous records. I cannot use rewrite, erase or truncate as I get I/O errors on these procedures as I do not have rights to delete any file on F: How can I open my text file, loop through it to whitespace any records and then append the new data. This text file is being populated from some list boxes on my form.
Please help if you can.
Thank you
 Sam Kapoor
0
Comment
Question by:skapoor072897
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
jackb022197 earned 0 total points
ID: 1340098
AssignFile(f, 'F:\yourfile.txt');
FileMode := 1;      { Write only }
Reset(f);

Then loop through your file and append...


0
 

Author Comment

by:skapoor072897
ID: 1340099
I have tried this bit of code, but I keep running into the same problem. First I define f as a file type variable. This is the code
egin
  AssignFile(f, 'f:\cmailtest\phone.txt');
  FileMode := 1; { Write only }
  Reset(f);
  while not eof(f) do
   begin
    writeln('     ');
   end;
On the writeln('      ') line I get an I/O error 103.
I have changed the variable f: to a textfile type and tried the sam e code with writeln(f,'      '). Same I/O error 103. I have tried writing to C instead of F but get the same I/O error. Maybe something is not write with the writeln statement. How do I write out whitespaces to this text file.
Please help if you can.
Thanks,
           SKapoor
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

656 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