ipfs add myfolderA_2.tar literally adds the binary tar format in IPFS, it does not unpack it into the underlying directory folder structure.
That why ipfs ls shows nothing, you are trying to ls a file, IPFS it does not parse the archive, for all that it knows that just a file made of some bytes like any other file.
The thing you ipfs cated is a USTAR - OSDev Wiki tar format, you are viewing the raw bytes of the archive as expected.
The simplest way to get the structure is to first unpack the tar file and then add that to ipfs tar -xvf myfolderA_2.tar then ipfs add -r the unpacked folders / files. It would be on the easier side easy to make a script that streams the tar to something like mfs if you want to avoid unpacking it temporarly.
Thank you for answering me. I explain to you. This arises from the need to recursively copy a folder to a remote node via CURL using the ipfs API, apparently you can’t send cards to ipfs via curl. I had read somewhere that switching to ipfs with CURL a TAR file would then have the possibility to browse the contents with “ipfs ls”. Can you give me some advice on how to send a folder to a remote node using CURL?
It’s not using a tar file and I don’t think you can send one, ipfs get use a tar file under the hood over http, so if you use the API you can keep the tar file and don’t unpack it, I don’t think that works with ipfs add altho that seems like a fine addition.
A lazy way to accomplish this would be to utilize MFS. Do ipfs add per file you want to add, then do ipfs files cp & ipfs files mkdir to build the tree you want.
multipart/form-data is ideal, but if you’re blocked on that, my idea should get the job done.