Solved

How to delete files in Delphi ?

Posted on 1998-07-29
3
175 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
3 Comments
 
LVL 5

Accepted Solution

by:
Christian_Wenz earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
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…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now