Show / Hide Table of Contents

Method pathname.isFullPathExpand(+ 1 overload)


Overload

Expands environment variables and calls/returns pathname.isFullPath.

public static bool isFullPathExpand(ref string path, bool? strict = null)
Parameters
path  (string)

Any string. Can be null. If starts with '%' character, calls pathname.expand and then pathname.isFullPath with expanded environment variables. If it returns true, replaces the passed variable with the expanded path string.

strict  (bool?)

What to do if path looks like starts with and environment variable or known folder but the variable/folder does not exist:

  • true - throw ArgumentException;
  • false - return unexpanded path;
  • null (default) - call print.warning and return unexpanded path.
Returns
bool

true if the string is full path, like @"C:\a\b.txt" or @"C:" or @"\\server\share\...".

Remarks

Returns true if path matches one of these wildcard patterns:

  • @"?:\*" - local path, like @"C:\a\b.txt". Here ? is A-Z, a-z.
  • @"?:" - drive name, like @"C:". Here ? is A-Z, a-z.
  • @"\\*" - network path, like @"\\server\share\...". Or has prefix @"\\?\".

Supports '/' characters too. Supports only file-system paths. Returns false if path is URL (pathname.isUrl) or starts with "::".


Overload(top)

Expands environment variables and calls/returns pathname.isFullPath.

public static bool isFullPathExpand(string path, out string path2, bool? strict = null)
Parameters
path  (string)

Any string. Can be null. If starts with '%' character, calls pathname.expand and then pathname.isFullPath with expanded environment variables. If it returns true, sets path2 = the expanded path string.

path2  (string)

Receives the final path.

strict  (bool?)

What to do if path looks like starts with and environment variable or known folder but the variable/folder does not exist:

  • true - throw ArgumentException;
  • false - return unexpanded path;
  • null (default) - call print.warning and return unexpanded path.
Returns
bool

true if the string is full path, like @"C:\a\b.txt" or @"C:" or @"\\server\share\...".

Remarks

Returns true if path matches one of these wildcard patterns:

  • @"?:\*" - local path, like @"C:\a\b.txt". Here ? is A-Z, a-z.
  • @"?:" - drive name, like @"C:". Here ? is A-Z, a-z.
  • @"\\*" - network path, like @"\\server\share\...". Or has prefix @"\\?\".

Supports '/' characters too. Supports only file-system paths. Returns false if path is URL (pathname.isUrl) or starts with "::".