summaryrefslogtreecommitdiff
path: root/test/ninep.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-30 17:35:06 -0300
committerGabriel Schneider <[email protected]>2026-10-30 17:35:06 -0300
commit6d8da8721141284cf33bb901168b26135893eb86 (patch)
tree791d63401d4e85fbca1d597a8ce0326e70efd545 /test/ninep.py
parentefd43a3a2cf03bb741366331158b368abf9ac583 (diff)
parentbf6810a8f9d6cc82050e7d9c0cfb06358301b574 (diff)
downloadpardes-6d8da8721141284cf33bb901168b26135893eb86.tar.gz
pardes-6d8da8721141284cf33bb901168b26135893eb86.zip
Merge latest upstream into the macOS branch for Zig 0.17
Retain the macOS branch history and local Acme selection color while adopting upstream's current core and platform changes. Pin Zig and ZLS to 0.17.0, and fetch the existing zstbi compatibility commit through upstream after its original fork was removed.
Diffstat (limited to 'test/ninep.py')
-rw-r--r--test/ninep.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ninep.py b/test/ninep.py
index 6c625951..ac4e146b 100644
--- a/test/ninep.py
+++ b/test/ninep.py
@@ -97,6 +97,25 @@ class Client:
def close(self, fid):
self.rpc(120, struct.pack('<I', fid))
+ def create(self, path, name, perm=0o777, mode=0):
+ """Tcreate `name` in the directory `path`; returns the new qid."""
+ fid = self.walk(path)
+ try:
+ reply = self.rpc(114, struct.pack('<I', fid) + string(name) +
+ struct.pack('<IB', perm, mode))
+ if len(reply) != 17:
+ raise OSError('invalid create reply')
+ return reply[:13]
+ finally:
+ self.close(fid)
+
+ def mkdir(self, path, name):
+ return self.create(path, name, 0x80000000 | 0o777)
+
+ def remove(self, path):
+ """Tremove, which clunks the fid whether or not it succeeds."""
+ self.rpc(122, struct.pack('<I', self.walk(path)))
+
def read_fid(self, fid, offset=0, count=None):
count = min(count if count is not None else self.msize - 11, self.msize - 11)
reply = self.rpc(116, struct.pack('<IQI', fid, offset, count))