Skip to content

Refactor InternalSymbolicLinkLinkCodeMethods to consolidate Unix/Windows implementations at one place #4086

@daxian-dbw

Description

@daxian-dbw

Here is a CR comment in #4020:

I see that you are following a pattern like IsSameFileSystemItem or IsHardLink. Ideally, code here should be refactored to consolidate Unix/Windows implementations in one place and eliminate wrapper functions like IsSameFileSystemItem and IsHardLink. Instead, they should be

internal static bool IsSameFileSystemItem(string pathOne, string pathTwo)
{
#if UNIX
   // Unix implementation goes here
#else
   // Windows implementation goes here
#endif
}

The code should be refactored to reflect the above comment.

  • Refactor the existing methods there to consolidate the Unix/Windows implementations at one place.
  • The type is InternalSymbolicLinkLinkCodeMethods, so for utility methods that are not directly related to SymbolicLink, such as GetInodeData, maybe a separate type should be created to hold them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or more

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions