From 66c3f66ffbf888956c3b78531ccd58347abe5890 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 8 Jul 2024 15:28:25 -0500 Subject: remove symlink extensions --- src/slskd/Files/FileExtensions.cs | 21 --------------------- src/slskd/Files/FileService.cs | 3 +-- src/slskd/Relay/RelayService.cs | 1 + 3 files changed, 2 insertions(+), 23 deletions(-) (limited to 'src') 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); diff --git a/src/slskd/Relay/RelayService.cs b/src/slskd/Relay/RelayService.cs index 4595a516..7d5602a5 100644 --- a/src/slskd/Relay/RelayService.cs +++ b/src/slskd/Relay/RelayService.cs @@ -273,6 +273,7 @@ namespace slskd.Relay /// Initializes a new instance of the class. /// /// + /// /// /// /// -- cgit v1.2.3