You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
I am not sure if it is needed in the files namespace as you can pull out the hash of the file using files.stat and then use generic command to check of availability.
The command for checking that doesn't exist currently and doing it outside of files command-space would be more generic approach.
I don't think we should do this for similar reasons to why fs.exists is deprecated in node core:
Using fs.exists() to check for the existence of a file before calling fs.open(), fs.readFile() or fs.writeFile() is not recommended. Doing so introduces a race condition, since other processes may change the file's state between the two calls. Instead, user code should open/read/write the file directly and handle the error raised if the file does not exist.
A user can simulate it with ipfs.files.stat(pathOrCID) but we should not encourage it's use.
Following proposal on ipfs/js-ipfs#780 by @aphelionz, we would have:
The text was updated successfully, but these errors were encountered: