mirror of https://codeberg.org/cage/tinmop/
- [kami] made an effort to replicate the permissions when uploading a file.
This commit is contained in:
parent
f46fb4dc14
commit
560e01e09e
|
@ -314,6 +314,11 @@
|
|||
|
||||
(define-stat-time atime)
|
||||
|
||||
(defun get-stat-mode (file)
|
||||
(let ((raw (nix:stat-mode (nix:stat file))))
|
||||
(values raw
|
||||
(logand raw #o777))))
|
||||
|
||||
(defun file-hash (file)
|
||||
(num:fnv-hash-32 (slurp-file file :convert-to-string nil)))
|
||||
|
||||
|
|
|
@ -118,6 +118,7 @@
|
|||
(lambda (source-path destination-path)
|
||||
(let* ((*stream* stream)
|
||||
(*root-fid* root-fid))
|
||||
(let ((source-permissions (fs:get-stat-mode source-path)))
|
||||
(with-open-file (input-stream source-path
|
||||
:direction :input
|
||||
:element-type +octect-type+)
|
||||
|
@ -135,7 +136,8 @@
|
|||
(when (< read-so-far +download-buffer+)
|
||||
(return-from write-loop t)))
|
||||
(9p:9p-clunk *stream* fid)
|
||||
(9p:read-all-pending-messages stream)))))))
|
||||
(9p:change-mode *stream* *root-fid* destination-path source-permissions)
|
||||
(9p:read-all-pending-messages stream))))))))
|
||||
|
||||
(defun query-path (stream root-fid)
|
||||
(lambda (path what)
|
||||
|
|
|
@ -306,6 +306,7 @@
|
|||
:get-stat-mtime
|
||||
:get-stat-ctime
|
||||
:get-stat-atime
|
||||
:get-stat-mode
|
||||
:file-outdated-p
|
||||
:file-exists-p
|
||||
:directory-exists-p
|
||||
|
|
Loading…
Reference in New Issue