1
0
Fork 0

- [kami] made an effort to replicate the permissions when downloading a file.

This commit is contained in:
cage 2022-02-13 16:12:16 +01:00
parent 560e01e09e
commit fbd59ea015
3 changed files with 9 additions and 1 deletions

View File

@ -319,6 +319,9 @@
(values raw
(logand raw #o777))))
(defun change-path-permissions (path mode)
(nix:chmod path mode))
(defun file-hash (file)
(num:fnv-hash-32 (slurp-file file :convert-to-string nil)))

View File

@ -111,7 +111,11 @@
path
(lambda (data offset count)
(declare (ignore offset count))
(write-sequence data output-stream))))))
(write-sequence data output-stream)))))
(let* ((info-source-node (9p:path-info *stream* *root-fid* path))
(permissions (9p:permissions-original-value (9p:stat-mode info-source-node)))
(destination-file-mode (logand permissions #x7ff)))
(fs:change-path-permissions destination-file destination-file-mode)))
destination-file))
(defun upload-node (stream root-fid)

View File

@ -307,6 +307,7 @@
:get-stat-ctime
:get-stat-atime
:get-stat-mode
:change-path-permissions
:file-outdated-p
:file-exists-p
:directory-exists-p