Skip to content

Commit

Permalink
Update functions.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tidy-Coder authored Aug 6, 2024
1 parent c1838c8 commit c289173
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions c#/functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,26 @@ bool isFolder(string tidyPath){
bool isFile(string tidyPath){
return File.Exists(tidyPath);
}
bool delete(string tidyPath){
if(this.isFolder(tidyPath)){
try{
Directory.Delete(tidyPath, true);
return true;
}
catch(Exception e){
return false;
}
}
else if(this.isFile(tidyPath)){
try{
File.Delete(tidyPath);
return true;
}
catch(Exception z){
return false;
}
}
return false;
}
}
}

0 comments on commit c289173

Please sign in to comment.