Skip to content

fix: mask file mode #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2019
Merged

fix: mask file mode #39

merged 1 commit into from
Dec 23, 2019

Conversation

achingbrain
Copy link
Member

Only expose documented bits to calling code but respect them when turning the entry into a protobuf.

Implements ipfs/specs#231

Only expose documented bits to calling code but respect them when
turning the entry into a protobuf.
@achingbrain
Copy link
Member Author

cc @ribasushi

@@ -80,7 +80,8 @@ class Data {
this.fanout = fanout
this.blockSizes = blockSizes || []
this.mtime = mtime || new Date(0)
this.mode = mode
this.mode = mode || mode === 0 ? (mode & 0xFFF) : undefined

Choose a reason for hiding this comment

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

@achingbrain just want to doublecheck I am reading the precedence right. Are you saying:

assign mode & 0xFFF IF mode is non-zero numeric ( truthy) OR literal 0 OTHERWISE undefined

The rest looks great

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's correct, truthy or literal 0

@achingbrain achingbrain merged commit 09fd4ed into master Dec 23, 2019
@achingbrain achingbrain deleted the mask-file-mode branch December 23, 2019 07:21
achingbrain added a commit that referenced this pull request Feb 19, 2020
* feat: support storing metadata in unixfs nodes

Adds `mtime` and `mode` properties to `{path, content}` import entries

* chore: remove gh url

* chore: upgrade node

* chore: update deps

* fix: add metadata to directories too

* fix: add metadata to imported directories
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.

4 participants