mirror of
https://github.com/jcreek/YouTubeChannelDownloader.git
synced 2026-07-13 11:13:46 +00:00
feat(*): Add DeleteLocalFile
This commit is contained in:
@@ -145,5 +145,24 @@ namespace YouTubeChannelDownloader
|
|||||||
|
|
||||||
Console.WriteLine("SFTP done");
|
Console.WriteLine("SFTP done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void DeleteLocalFile(string pathString)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Check if file exists with its full path
|
||||||
|
if (File.Exists(pathString))
|
||||||
|
{
|
||||||
|
// If file found, delete it
|
||||||
|
File.Delete(pathString);
|
||||||
|
Console.WriteLine("Local file deleted.");
|
||||||
|
}
|
||||||
|
else Console.WriteLine("Local file not found");
|
||||||
|
}
|
||||||
|
catch (IOException ioExp)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ioExp.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user