Solved

How to delete files in Delphi ?

Posted on 1998-07-29
3
189 Views
Last Modified: 2010-04-04
Hi experts,

How can I delete a file in Delphi 3.0?

In Visual Basic, I would try it like this

Kill(filename).

How can this be done in Delphi language?

Yours sincerely

Christian
0
Comment
Question by:mathes
[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
3 Comments
 
LVL 5

Accepted Solution

by:
Christian_Wenz earned 50 total points
ID: 1359075
The following code erases the file DELETE.ME in the current directory:

DeleteFile('DELETE.ME');

(from delphi help)
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1359076
If you want in a different directory same thing as above but add the path to the file like thid...
DeleteFile('C:\windows\desktop\vik.txt');
that's only for deleting one file at a time..if you need to delete a whole directory then you need to use the TSHFileOpStruct that is declared in the ShellAPI...

Regards,
Viktor Ivanov
0
 

Author Comment

by:mathes
ID: 1359077
Thank you for your help and comments. Yes,the answer is indeed the help file of delphi. For a Delphi novice like me it is difficult to get a complete overview
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 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