I understand this, but this is currently not possible.
Can you give a concrete example, where it’s necessary to ask for this informations?
Well, the reason for this limitation is, for IPFS is firstly everything one thing: blocks. So there’s not a dedicated ‘metadata’ vs ‘data’ separation on the network side.
If you do a
ipfs refs <CID there will be just the blocks fetched which are necessary to answer this ‘question’. If the CID belongs to a file, it’s likely that only the first block (default block size is 256 KByte) will be fetched. If the CID belongs to a directory, the size might be up to 1 MB at the moment, depending on the amount of files stored in the directory. If you have sharding enabled, the directory will be split in multiple blocks, and thus might be larger than 1 MB.
Note: A directory is usually pretty small.
As an example:
$ ipfs files ls /exampledir | wc -l
$ ipfs block stat QmRa6nnXCu9BCMZ3PmSpd4aKrry35otbwWR8umK3H994Fo
True. It also takes a while until IPFS gets back its network connections.
Yes, but not on the same block store/datastore. If a process is already running, it will create a lock file.