Skip to content
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

Add inode support #200

Merged
merged 1 commit into from Sep 29, 2019

Conversation

@bizurkur
Copy link
Member

commented Sep 27, 2019

Use spl_object_id() to act as the file system inode. spl_object_id() gives a unique identifier for every object, thus there should never be two overlapping "inodes."

@bizurkur bizurkur requested a review from bovigo/vfsstream Sep 27, 2019
@allejo

This comment has been minimized.

Copy link
Member

commented Sep 27, 2019

Once the object is destroyed, its id may be reused for other objects.

from: spl_object_id docs

Could this potentially cause problems and generate overlapping "inodes?"

@bizurkur

This comment has been minimized.

Copy link
Member Author

commented Sep 27, 2019

It shouldn't. That's the same concept a real file system uses. If the disk is full (out of inodes), you need to delete a file to create a new file and the new file will have the same inode as the old file.

Reusing is ok, as long as two identical inodes never exist at the same time (with the exception of hard linked files, which do have the same inode, but not something that exists in vfs).

@allejo
allejo approved these changes Sep 28, 2019
Copy link
Member

left a comment

Got it! I like the use of spl_object_id() for this! 👍

@allejo allejo requested a review from bovigo/vfsstream Sep 28, 2019
Copy link
Member

left a comment

LGTM

@bizurkur bizurkur merged commit d8bacb5 into bovigo:master Sep 29, 2019
4 checks passed
4 checks passed
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 95.213%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.