-
Notifications
You must be signed in to change notification settings - Fork 298
how do i call the equivalent of ipfs add -r
?
#33
Comments
See #22 |
i think |
fixed in #34 i believe. |
nope, not fixed. this works for adding single files, but not directories. the i would add |
It should handle |
This is issue seemed to be fixed in 2.2.1. You can do "ipfs add -r" with |
anyone have a sample Curl command for adding a directory? just a simple directory where all files are on the same local machine |
@haadcode Do you know if it's possible to do this in the browser, i.e. without a file system? Let's say I have some strings "hello", "world", "something", can I create an IPFS object representing a directory with files |
I'm not sure of all the changes that have happened, but if the API hasn't changed too much since I last worked on it, you should be able to pass an array of vinyl file like objects. ipfs.add([
{cwd: '/', base: '/', path: '/hello.txt', contents: new Buffer("Hello")},
{cwd: '/', base: '/', path: '/world.txt', contents: new Buffer("World")}
]) To wrap files in a directory you can just add a directory to the path, and building folders should work with just nesting file into directories with the path. @diasdavid can probably answer the question more directly though. |
The current binary on Windows does not recursively add directories, also when executing the same operation multiple times (number of files added is not consistent) ipfs can crash: d:\Programs>ipfs add -r BC3 syscall.Syscall9(0x7fefeed13b0, 0x7, 0x224, 0xc0822368b0, 0x1, 0xc082236898, 0x0, 0xc082236868, 0x0, 0x0, ...) goroutine 1 [chan receive]: goroutine 6 [chan receive]: goroutine 7 [select]: goroutine 8 [syscall]: goroutine 15 [chan receive]: goroutine 40 [IO wait]: goroutine 34 [select]: goroutine 35 [select]: goroutine 38 [select]: |
@jurgen-kluft you will probably want to submit this as a seperate issue over at ipfs/go-ipfs. This current issue thread is about the JavaScript lib to talk to a IPFS Node. |
Ok, done: #176 |
This is resolved in the latest version. |
how do i call the equivalent of
ipfs add -r
?passing the filenames is not enough as i may not be in the same machine.
is there
vinyl-fs
support?The text was updated successfully, but these errors were encountered: