- Home /
Question by
bastianmeyerbm3 · Sep 13, 2018 at 05:52 PM ·
filedeletepersistentdatapath
Mobile delete file with specific file extension
hi,
i am currently working on an App that stores mp4 files in the Persistent Data Path of the application. How can i find all files with the .mp4 extension and delete them?
edit: the problem is. I dont know the exact filenames. They look like: 43.mp4 or 3279.mp4
Comment
Best Answer
Answer by mjdb3d · Sep 13, 2018 at 07:03 PM
Hi,
you can use this code:
string[] files = System.IO.Directory.GetFiles( YourPath, "*.mp4", SearchOption.AllDirectories);
foreach( string filepath in files)
{
System.IO.File.Delete( filepath ));
}
Your answer
Follow this Question
Related Questions
How to delete everything at Application.persistentDataPath? 3 Answers
How to save a .txt file into a specified folder 1 Answer
Delete Folder? 2 Answers
Accessing a file from Application.persistentDataPath 2 Answers
"Source file could not be found" error after editor script creates and deletes a cs file 3 Answers