Skip to content

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

Open
@adhvaitaganesh

Description

@adhvaitaganesh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions