Safe cat vs safe get

During the tests, I’ve seen a lot of people using the command safe files cat, to retrieve files
but it is limited, right ?
you have to check the content of the file first (if you don’t know the type of data) and redirect it, you have no options to see the progress…
how about using the command safe files get instead ?

  • put my file(s) in a folder (data)
  • safe files put -r ./data
  • note the container id

then, to retrieve it, in a temp folder :

  • safe files get -i bars safe://[container id] ./temp/

Here I have the progress bars, I don’t have to bother with extension, and I suspect that safe files get handle data a bit differently (?)

2 Likes

get operates with 2 entities - container and file data.
For cat only 1 is enough - file data.
Because of this it is easier to make tests with cat.
For example, get may fail if container data is lost and if file data is lost, which may be hard to distinguish.
(I’m not sure about all of this, so correct me if I’m wrong)

1 Like

I fell into using cat because get could only handle containers, so cat would at least always do something, even if just download the container when given.

I remember reading get would be updated to work on files as well, did they do that yet? Progress bars sound good, not having to manually name every file sounds good.

2 Likes

Just some background info, the cat is meant to work with absolutely any type of content stored on the network, if the content resolved from the URL provided is a container it pretty prints it (e.g. FilesContainers, Wallets, etc.), so it’s just the Safe version of the cat command of Linux systems with the addition of pretty printing containers. The files get subcommand is meant for only getting/retrieving files stored on FilesContainers.

The dog is meant for inspecting the URL provided, how it’s resolved all the way down to a final piece of content, showing all metadata available in each step of such resolution process. This command doesn’t show the actual data of the targeted content, so it’s more for understanding what a URL resolves to and what type of data is found throughout the process.

11 Likes