AcTools.Utils.FileUtils.DeleteFile C# (CSharp) Method

DeleteFile() private static method

private static DeleteFile ( string path, FileOperationFlags flags ) : bool
path string
flags FileOperationFlags
return bool
        private static bool DeleteFile(string[] path, FileOperationFlags flags) {
            if (path == null || path.All(x => x == null)) return false;
            try {
                var fs = new SHFILEOPSTRUCT {
                    wFunc = FileOperationType.FO_DELETE,
                    pFrom = string.Join("\0", path.Where(x => x != null)) + "\0\0",
                    fFlags = flags
                };
                SHFileOperation(ref fs);
                return true;
            } catch (Exception) {
                return false;
            }
        }