private static string ToFileOptionsString(FileOptions options) { string result = String.Empty; const FileOptions FILE_FLAG_OPEN_REPARSE_POINT = (FileOptions)0x00200000; const FileOptions FILE_FLAG_NO_BUFFERING = (FileOptions)0x20000000; if ((options & FILE_FLAG_OPEN_REPARSE_POINT) > 0) { result += "ReparsePoint|"; options &= ~FILE_FLAG_OPEN_REPARSE_POINT; } if ((options & FILE_FLAG_NO_BUFFERING) > 0) { result += "NoBuffering|"; options &= ~FILE_FLAG_NO_BUFFERING; } if (result == String.Empty || options != FileOptions.None) { result += options.ToString().Replace(", ", "|"); } result = result.TrimEnd(new char[] { '|' }); return(result); }