Connection
Base URL, credentials and a reachable server.
Check setuid, setgid and sticky bits with and without execute permission, rejecting negative or oversized modes without changing any file.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
def permission_text(mode):
if type(mode) is not int or not 0 <= mode <= 0o7777:
raise ValueError("permission bits only")
out = []
for shift in (6, 3, 0):
bits = (mode >> shift) & 7
out.extend(c if bits & bit else "-"
for c, bit in zip("rwx", (4, 2, 1)))
for pos, bit, mark in ((2, 0o4000, "s"), (5, 0o2000, "s"), (8, 0o1000, "t")):
if mode & bit: out[pos] = mark if out[pos] == "x" else mark.upper()
return "".join(out)