Search code examples
androiddelphifiremonkeydelphi-xe7

Deleting file from internal storage


How do I delete a file or folder on the internal storage in android with Delphi for android


Solution

  • You should use the TFile and TDirectory classes in the System.IOUtils unit.

    For example:

    TDirectory.Delete(<YOUR DIR PATH>);
    

    or

    TFile.Delete(<YOUR FILE PATH>);
    

    Look in Embarcadero's documentation to get the right path of your files and folders on the various platforms:

    Standard RTL Path Functions across the Supported Target Platforms