What am I doing wrong ?
$ ipfs daemon
$ ipfs add -r /Users/m/Desktop/img_test
added QmcDQDePjtXyS28aRFHuSXBiGifcL8jdihhDvvt3nteYww img_test/IMG_8831.jpg
added QmeT1dXQsGVGDgt5A2vQLDbMS4sPr1KsZG3vBKGnANRvtM img_test/IMG_8834.jpg
added QmbAqf4gCDqJAaWN5ZfaMz4yoBEkL2Z9ivcusHy8wpXTbA img_test
$ ipfs name publish QmbAqf4gCDqJAaWN5ZfaMz4yoBEkL2Z9ivcusHy8wpXTbA img_test
Error: Unknown Command "QmbAqf4gCDqJAaWN5ZfaMz4yoBEkL2Z9ivcusHy8wpXTbA"
you don't need to specify a path:
ipfs name publish QmbAqf4gCDqJAaWN5ZfaMz4yoBEkL2Z9ivcusHy8wpXTbAjust
$ ipfs name publish img_test ?
ps: can i create directory ?
Nope, as I written above, no directory name, just the hash of it.
When you publish, you specify exactly one hash.
If you want directories, put them in the tree: example:
mkdir -p a/b/c echo hello > a/b/c/hello.txt ipfs add -r a … SOMEHASH ipfs name publish SOMEHASHyou will then find the CONTENT of
a(note that the name ofawill not appear anywhere): so you will find the directoryb, which includes the directoryc, which includeshello.txtif you modify the content of
a, just add it again, and publish the new hash.