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

Validation Error: Mutable File System - Lesson 11 (Remove a file or directory) #859

Open
adhvaitaganesh opened this issue Jan 21, 2023 · 0 comments

Comments

@adhvaitaganesh
Copy link

If you submitted code for a lesson and received feedback indicating a validation error, you may have uncovered a bug in our lesson validation code. We've prepopulated the error type and the last code you submitted below as diagnostic clues. Feel free to add additional feedback about the lesson below before clicking "Submit new issue."

Before your code submission errored out, had you found anything about this lesson confusing?

Any other feedback you'd like to share about this lesson?

Any other feedback you'd like to share about ProtoSchool?

Thank you for submitting your feedback to help us diagnose the problem!
-----------------------------------------------------------------------
Please do not edit the diagnostic information below this line.

Error type:

    Validation timeout

The code that caused the error:

/* global ipfs, all */

const run = async (files) => {
  await Promise.all(files.map(f => ipfs.files.write('/' + f.name, f, { create: true })))
  await ipfs.files.mkdir('/some/stuff', { parents: true })
  let rootDirectoryContents = await all(ipfs.files.ls('/'))
  const filepathsToMove = rootDirectoryContents.filter(file => file.type === 0).map(file => '/' + file.name)
  await ipfs.files.mv(...filepathsToMove, '/some/stuff')
  await ipfs.files.cp('/ipfs/QmWCscor6qWPdx53zEQmZvQvuWQYxx1ARRCXwYVE4s9wzJ', '/some/stuff/success.txt')
  let someStuffDirectoryContents = await all(ipfs.files.ls('/some/stuff'))

  // Your code goes here
  ipfs.files.rm('/some' , { recursive: true } )

  let finalRootDirectoryContents = await all(ipfs.files.ls('/'))
  return finalRootDirectoryContents
}

return run
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

No branches or pull requests

1 participant