Skip to content

Class DevicePathUtil

Namespace: Belay.Sync
Assembly: Belay.Sync.dll

Provides utilities for handling device file paths in a cross-platform manner. MicroPython/CircuitPython devices use Unix-style paths regardless of the host OS.

csharp
public static class DevicePathUtil

Inheritance

objectDevicePathUtil

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Fields

DeviceRoot

The root directory path on devices.

DeviceSeparator

The path separator used on MicroPython/CircuitPython devices (always forward slash).

Methods

Combine(params string[])

Combines multiple path segments into a single device path.

FromHostPath(string, string?)

Converts a host file system path to a device path format.

GetDirectoryName(string)

Gets the directory name of the specified path.

GetExtension(string)

Gets the extension of the specified path.

GetFileName(string)

Gets the file name from the specified path.

GetFileNameWithoutExtension(string)

Gets the file name without its extension.

IsUnderDirectory(string, string)

Determines if the specified path is under the given parent directory.

IsValidPath(string?)

Determines whether the specified path is a valid device path.

NormalizePath(string?)

Normalizes a device path by ensuring it uses forward slashes and removing redundant separators.

ToHostPath(string, string)

Converts a device path to a host file system path format.

Released under the Apache License 2.0.