Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Additional overload of Path.GetFullPath that takes the current folder #301

@HugoRoss

Description

@HugoRoss

Request:
I would like to see 4 more overloads of Path.GetFullPath (method signatures see below) that accept the current folder as an additional argument.

    public static string GetFullPath(string path, string currentFolder) { }
    public static string GetFullPath(string path, string currentFolder, GetFullPathOptions options) { }
    public static string GetFullPathTransacted(KernelTransaction transaction, string path, string currentFolder) { }
    public static string GetFullPathTransacted(KernelTransaction transaction, string path, string currentFolder, GetFullPathOptions options) { }

Reasons:

  1. As mentioned in the method description, Path.GetFullPath is not thread-safe because it's accessing Environment.CurrentDirectory to determine the directory that may change between or during the call. If I can store the CurrentDirectory in a local variable and pass it to Path.GetFullPath I can call it n times in a row and get consistent results.
  2. Environment.CurrentDirectory throws an exception, if the folder does not exist, disallowing it to get the full path of a not yet existing current folder. Imagine a setup scenario where the target folder only exists yet as a string result coming from a wizard page (the root folder where the application is going to be installed).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions