Skip to content

Commit 58dd40b

Browse files
committed
Refactor last commit
1 parent 7c79e06 commit 58dd40b

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

DiscordChatExporter.Core/Utils/Extensions/PathExtensions.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
using System;
22
using System.IO;
3-
using System.Linq;
43
using System.Text;
54

65
namespace DiscordChatExporter.Core.Utils.Extensions;
76

87
public static class PathExtensions
98
{
10-
// Characters that are invalid on common filesystems.
119
// This is a union of invalid characters from Windows (NTFS/FAT32), Linux (ext4/XFS), and macOS (HFS+/APFS).
1210
// We use this instead of Path.GetInvalidFileNameChars() because that only returns OS-specific characters,
13-
// not filesystem-specific characters. This means that it's possible to use, for example, an NTFS drive on
14-
// Linux, which would allow the OS to create filenames with '?' but result in errors when writing to the filesystem.
11+
// not filesystem-specific characters. It's possible to use, for example, an NTFS drive on Linux,
12+
// which would make some additional characters invalid that are otherwise valid on Linux.
1513
// https://github.com/Tyrrrz/DiscordChatExporter/issues/1452
1614
private static readonly char[] InvalidFileNameChars =
1715
[
1816
'\0', // Null character - invalid on all filesystems
19-
'/', // Path separator on Unix
17+
'/', // Path separator on Unix and Windows
2018
'\\', // Path separator on Windows
2119
':', // Reserved on Windows (drive letters, NTFS streams)
2220
'*', // Wildcard on Windows

0 commit comments

Comments
 (0)