HostFileBackend

org.llm4s.agent.harness.HostFileBackend
See theHostFileBackend companion class

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

object Kept

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Kept.type

Value members

Concrete methods

def fileSystemIdOf(p: Path): String

Which file system p is on, without following a final link: its unix:dev where the JDK reports it, else (Windows) its volume's serial number, or the store's name where the volume has none. Never the store's rendering, which on Windows carries the path's form (a path past MAX_PATH is reached as \\?\C:\...), so one volume would read as two. The backend never enters a path whose file system differs from the root's.

Which file system p is on, without following a final link: its unix:dev where the JDK reports it, else (Windows) its volume's serial number, or the store's name where the volume has none. Never the store's rendering, which on Windows carries the path's form (a path past MAX_PATH is reached as \\?\C:\...), so one volume would read as two. The backend never enters a path whose file system differs from the root's.

Attributes

def mountPointsBeneath(root: Path): Result[Vector[Path]]

The mount points strictly beneath root, from Linux's /proc/self/mountinfo: a bind mount of the root's own file system has the root's device, so only the mount table shows it. Empty where there is no such table (macOS and Windows have no same-device bind mounts; their other mounts differ in file system, which fileSystemIdOf catches).

The mount points strictly beneath root, from Linux's /proc/self/mountinfo: a bind mount of the root's own file system has the root's device, so only the mount table shows it. Empty where there is no such table (macOS and Windows have no same-device bind mounts; their other mounts differ in file system, which fileSystemIdOf catches).

Attributes

def open(root: Path, lockDirectory: Path, maxFileBytes: Long, maxScanEntries: Int, allowUncheckedIdentity: Boolean): Result[HostFileBackend]

A backend over the existing directory root, resolved to its real path, as its only writer.

A backend over the existing directory root, resolved to its real path, as its only writer.

'''The lock.''' open takes an exclusive OS lock on the root's lock file and a shared lock on each of its ancestors' (design ยง4.40), in lockDirectory, and holds them until HostFileBackend.close. A root another backend has open, or one containing or inside one open, is refused with HostRootInUse. Directories are named by their file key (device and inode) where the platform has one, so a root reached through a symbolic link or a bind mount is the same root. Give every process on the host that may open the same or overlapping roots one lock directory, on a local file system, that nothing prunes (a temporary directory a cleaner empties is a poor choice); it is created if absent and must not be inside the root.

'''Refused at open''', besides a missing root, bad limits and a root in use:

  • a root whose file system resolves 8.3 short names (found by a probe file created and removed in the root): never waived;
  • a root whose identity cannot be checked: one that cannot be probed (read-only), on a file system that reports no hard-link counts (NTFS), or on Linux one whose mount table cannot be read - unless allowUncheckedIdentity, the caller vouching that the root has no hard links and no 8.3 names;
  • a root with another file system mounted beneath it (a bind mount included): never waived.

Attributes

def probeAliases(root: Path): Result[Vector[String]]

The 8.3 short names a root's file system resolves, found by trying it: a probe file is created in root and looked up by its short name; the probe is then removed. Right lists what was found (empty: none); Left means the root could not be probed (for example, it is read-only).

The 8.3 short names a root's file system resolves, found by trying it: a probe file is created in root and looked up by its short name; the probe is then removed. Right lists what was found (empty: none); Left means the root could not be probed (for example, it is read-only).

Attributes

def reportsLinkCounts(root: Path): Boolean

Whether root's file system reports hard-link counts (the unix attribute view): POSIX does, NTFS not.

Whether root's file system reports hard-link counts (the unix attribute view): POSIX does, NTFS not.

Attributes

Concrete fields

4 MiB: the default bound on one file.

4 MiB: the default bound on one file.

Attributes

The default bound on the entries one listing or walk visits.

The default bound on the entries one listing or walk visits.

Attributes

val MaxFileBytes: Long

The largest maxFileBytes: a file is read into one array, which holds at most this many bytes.

The largest maxFileBytes: a file is read into one array, which holds at most this many bytes.

Attributes