Method for creating new directory object w/ set of links
See original GitHub issueGiven a list or iterable of {"Hash": CID, "Name": str}
objects, it should be possible to create a new directory object using object.put
without having to manually create the directory object in bytes, query the size of links, or recursively add single links to directories one at a time (creating intermediate objects). Not sure if I’m missing an API for how to do this, but it would be pretty helpful.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
New-Item (Microsoft.PowerShell.Management)
The New-Item cmdlet creates a new item and sets its value. The types of items that can be created depend on the location...
Read more >Create Directory (CRTDIR) - IBM
The Create Directory (CRTDIR) command adds a new directory to the system. A directory is an object that contains the names of other...
Read more >Creating and Reading Directories (The Java™ Tutorials ...
You can create a new directory by using the createDirectory(Path, FileAttribute<?>) method. If you don't specify any FileAttributes , the new directory will ......
Read more >Symlink Tutorial in Linux – How to Create and Remove a ...
A symlink (also called a symbolic link) is a type of file in Linux that points to another file or a folder on...
Read more >How to Create a Directory in PowerShell? - eduCBA
.net framework class and System.io. a directory object is used to create directories. The path and related links are created along with the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The recently added
.dag.put
would allow for this more easily… Except that it doesn’t expose the requiredformat
parameter in the implementation I just merged two days ago 🤦 .(See its upstream docs for why: https://ipfs.io/ipns/docs.ipfs.io/reference/http/api/#api-v0-dag-put)
Yeah, it probably won’t be hyper-fast. Unfortunately, there exists no HTTP API in IPFS to upload whole directories as lists of CIDs. (Since both
.add
and.tar.add
[not implemented] requires one to include the file bodies to upload as well.) Maybe the relatively new.dag.import
could be used but then we’d need to generate CAR (content-addressable archive) data.If you need the extra performance, it’s probably best to do what @SupraSummus did and just generate the relevant UnixFS protobuf datastructures yourself (using
.block.put
). They are not overly complicated.We really need a Python IPLD library to make this kind of stuff easier though.