Skip to content

Conversation

@moldis
Copy link
Contributor

@moldis moldis commented Jun 5, 2021

Possibility to create dir without files inside

zbox createdir --allocation dd60f818349bac486f95780a2024c3c17e6e4fa598cd324206381d4cd6733f85 --dirname /test777

zbox list-all --allocation dd60f818349bac486f95780a2024c3c17e6e4fa598cd324206381d4cd6733f85

Will include new dir

"name":"test777","num_of_blocks":2,"path":"/test777","path_hash":"a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a","size":2,"type":"d","updated_at":"2021-07-12T15:06:05.419607Z"}

@guruhubb guruhubb requested a review from Sriep June 19, 2021 21:38
@moldis moldis changed the title [WIP] createDir function createDir function Jun 23, 2021
@moldis moldis marked this pull request as ready for review June 23, 2021 16:47
@lpoli
Copy link
Contributor

lpoli commented Jun 25, 2021

For file upload blobber first puts the file in temporary directory for certain time and only upon commit transaction the file is moved to permanent directory.
CreateDir function has put new directory path directly into permanent directory.
I suppose Blobber should get paid for empty directory too.

@stewartie4
Copy link
Contributor

This is great! A much needed feature

If I understand right though, this action does not need committed?

In terms of payment, an empty directory technically takes up some space in the file system table but ultimately is empty - should blobbers be paid for an empty directory?
Unless a temp hidden file is committed to an empty directory thereby enabling the blobber to be paid

@guruhubb
Copy link
Member

Blobbers do not charge for rename, share, delete, copy, move, add-collab, and emptyDir creation. Blobbers do carry the cost of commit transactions to the chain but we expect that to be minimal. If there is an crud attack, the Blobbers can reduce the commit frequency.

@Sriep Sriep merged commit 502d2ab into master Jul 14, 2021
@Sriep Sriep deleted the feature/create_dir branch July 14, 2021 11:28
newDir.Name = dirName
newDir.Size = 2
newDir.NumBlocks = 2
newDir.ParentPath = dirRef.Path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be

newDir.ActualFileSize = 0
newDir.Size = 0
newDir.NumBlocks = 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants