diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-07-08 15:28:25 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-07-08 16:00:50 -0500 |
| commit | 66c3f66ffbf888956c3b78531ccd58347abe5890 (patch) | |
| tree | 2d206973461a61935dae9e6305de50e66a93d9cc /src/slskd/Files | |
| parent | bc8efd12e033c4bc74b0d0a604396d1ff52210e1 (diff) | |
| download | slskd-66c3f66ffbf888956c3b78531ccd58347abe5890.tar.gz | |
remove symlink extensions
Diffstat (limited to 'src/slskd/Files')
| -rw-r--r-- | src/slskd/Files/FileExtensions.cs | 21 | ||||
| -rw-r--r-- | src/slskd/Files/FileService.cs | 3 |
2 files changed, 1 insertions, 23 deletions
diff --git a/src/slskd/Files/FileExtensions.cs b/src/slskd/Files/FileExtensions.cs index 21395837..4aa7a648 100644 --- a/src/slskd/Files/FileExtensions.cs +++ b/src/slskd/Files/FileExtensions.cs @@ -59,25 +59,4 @@ public static class FileExtensions return (UnixFileMode)mode; } - -#nullable enable - public static FileInfo? TryFollowSymlink(this FileInfo fileInfo) - { - try - { - return fileInfo.FollowSymlink(); - } - catch (IOException) - { - return null; - } - } - - public static FileInfo FollowSymlink(this FileInfo fileInfo) - { - FileSystemInfo fileSystemInfo = fileInfo; - fileSystemInfo = fileSystemInfo.ResolveLinkTarget(returnFinalTarget: true) ?? fileSystemInfo; - return (FileInfo)fileSystemInfo; - } -#nullable restore }
\ No newline at end of file diff --git a/src/slskd/Files/FileService.cs b/src/slskd/Files/FileService.cs index aa2e42d4..eb261893 100644 --- a/src/slskd/Files/FileService.cs +++ b/src/slskd/Files/FileService.cs @@ -97,8 +97,7 @@ namespace slskd.Files // the link itself exists (which we've checked), and regardless of whether the link target itself exists. // we should only get this far if: // 1) the given file exists and - // 2) it is a symlink, meaning - // this line _SHOULD_ be guaranteed to return an instance of FileInfo. + // 2) it is a symlink, meaning this line _SHOULD_ be guaranteed to return an instance of FileInfo. try { info = (FileInfo)info.ResolveLinkTarget(returnFinalTarget: true); |
