Link to home
Start Free TrialLog in
Avatar of mathes
mathes

asked on

How to delete files in Delphi ?

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
ASKER CERTIFIED SOLUTION
Avatar of Christian_Wenz
Christian_Wenz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of mathes
mathes

ASKER

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