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

ipfs files cp/write from local fs? confusing errors? #3126

Open
jbenet opened this issue Aug 26, 2016 · 4 comments
Open

ipfs files cp/write from local fs? confusing errors? #3126

jbenet opened this issue Aug 26, 2016 · 4 comments
Labels
help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature

Comments

@jbenet
Copy link
Member

jbenet commented Aug 26, 2016

Version/Platform/Processor information (from ipfs version --all):

0.4.3-rc3

Type (bug, feature, meta, test failure, question): feature
Area (api, commands, daemon, fuse, etc): commands
Priority (from P0: functioning, to P4: operations on fire): P0
Description:

Would be nice if this worked:

> ipfs files cp /Users/earth/go/src/github.com/ipfs/go-ipfs/Makefile /Makefile
Error: file does not exist

The error is super confusing anyway.

@jbenet
Copy link
Member Author

jbenet commented Aug 26, 2016

  • Though I understand why this is hard-- when do you copy from local fs or files api. the trees could be the same.
  • Maybe this could be flags? ipfs files cp --from=sysfs [--to=repo]
  • Maybe instead we want something like ipfs files add <path-in-local-fs> [<path-in-files-api>], and if no second path is specified it defaults to /added/$(basename) this could go with the ipfs add -> ipfs files add potential move.

@jbenet
Copy link
Member Author

jbenet commented Aug 26, 2016

Ok this is confusing:

> ipfs files write /Makefile foo
Error: lstat foo: no such file or directory

because the doc says:

USAGE
  ipfs files write <path> <data> - Write to a mutable file in a given filesystem.

  ipfs files write [--offset=<offset> | -o] [--create | -e] [--truncate | -t] [--count=<count> | -n] [--] <path> <data>

  Write data to a file in a given filesystem. This command allows you to specify
  a beginning offset to write to. The entire length of the input will be written.

I take <data> to mean raw data. not <path> or <file>.

@jbenet
Copy link
Member Author

jbenet commented Aug 26, 2016

> cat Makefile | ipfs files write /Makefile
Error: file does not exist

Not the most helpful error. maybe:

> cat Makefile | ipfs files write /Makefile
Error: file does not exist - try using --create for writing new files.

@jbenet jbenet changed the title ipfs files cp from local fs? confusing error? ipfs files cp/write from local fs? confusing errors? Aug 26, 2016
@jbenet
Copy link
Member Author

jbenet commented Aug 26, 2016

For posterity, I succeeded with:

> cat Makefile | ipfs files write /Makefile --create

@em-ly em-ly added the kind/enhancement A net-new feature or improvement to an existing feature label Aug 29, 2016
@whyrusleeping whyrusleeping added the help wanted Seeking public contribution on this issue label Sep 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants