Given safe urls and safe xorurl share an overlapping namespace, I wondered about creating a roadblock to a file that doesn’t exist by creating a nrs at the xorurl of the other file but I’m not clear what happened and if it worked… perhaps someone else can try @Southside
So, getting the xorurl for a random file that does not exist on the network:
$ safe xorurl ./thisisatest No credentials found for CLI, connecting with read-only access... 1 file/s processed: ./thisisatest safe://hbyyyyddhpd545uynusc16893e84bw4yd3zf5okjph13eu155yy4ng38jt
For curiousity decoded:
$ safe xorurl decode safe://hbyyyyddhpd545uynusc16893e84bw4yd3zf5okjph13eu155yy4ng38jt Information decoded from XOR-URL: safe://hbyyyyddhpd545uynusc16893e84bw4yd3zf5okjph13eu155yy4ng38jt Xorname: 8f8d1ef5b98053b325e3ff283e834d0079b9770525bc9651396f6006846c9d31 Type tag: 0 Native data type: PublishedImmutableData Path: none Sub names:  Content version: latest
and cat with it not being uploaded
$ safe cat safe://hbyyyyddhpd545uynusc16893e84bw4yd3zf5okjph13eu155yy4ng38jt No credentials found for CLI, connecting with read-only access... [2020-04-12T10:04:51Z ERROR safe] safe-cli error: [Error] NetDataError - Failed to GET Published ImmutableData: CoreError(Data error -> Requested data not found - CoreError::DataError -> NoSuchData)
$ safe dog safe://hbyyyyddhpd545uynusc16893e84bw4yd3zf5okjph13eu155yy4ng38jt No credentials found for CLI, connecting with read-only access... Native data type: ImmutableData (published) XOR name: 0x8f8d1ef5b98053b325e3ff283e834d0079b9770525bc9651396f6006846c9d31 XOR-URL: safe://hbyyyyddhpd545uynusc16893e84bw4yd3zf5okjph13eu155yy4ng38jt Media type: Unknown
So, now I upload a roadblock other file and create an nrs that is the xorurl of the file that is thisisatest which is still not on the network.
$ safe files put ./roadblock FilesContainer created at: "safe://hnyynys9jwm9onjudcgomf3knc5h8aokqrdpqqfcts9b58i3jzsp1weo6rbnc" + ./roadblock safe://hbyyyynw7fi7ko8u3wtai6eekko3m5y6u9ud7w1i4ajycmwfwu3wwpnn81
and then create an nrs at the xorurl of the other file that has not been uploaded.
$ safe nrs create hbyyyyddhpd545uynusc16893e84bw4yd3zf5okjph13eu155yy4ng38jt --link safe://hbyyyynw7fi7ko8u3wtai6eekko3m5y6u9ud7w1i4ajycmwfwu3wwpnn81?v=0 New NRS Map for "safe://hbyyyyddhpd545uynusc16893e84bw4yd3zf5okjph13eu155yy4ng38jt" created at: "safe://hnyydyw5ijn4mqddua5h7hs97p637ew5thnmeigaob9bjii9jszpu1u3kybqh" + hbyyyyddhpd545uynusc16893e84bw4yd3zf5okjph13eu155yy4ng38jt safe://hbyyyynw7fi7ko8u3wtai6eekko3m5y6u9ud7w1i4ajycmwfwu3wwpnn81?v=0
step 4of3 shouldn’t work??
but it seemed that later I could do upload of the original file
safe files put ./thisisatest FilesContainer created at: "safe://hnyynyzdhb8gdoihqff3dpdpu6si44iqcoi71t5qfyymoduia4cju8z9znbnc" + ./thisisatest safe://hbyyyyddhpd545uynusc16893e84bw4yd3zf5okjph13eu155yy4ng38jt
The reason I couldn’t make sense of this above, was I got distracted by that the desktop browser appears to download content and I’d left the roadblock as an empty file.
bug or feature - desktop browser?
It seems that the desktop browser will download as content the file only on the back of what looks like a xorurl… so, for a zerofile and it seems for text files, it opens the download folder!..
which is a null content.
and safe://testk2 null
and safe://testk3 not null
still do the same… likely on the back of mediatype
Equally a surprise is safe://hello/index.html for which the xorurl doesn’t action the associate .css file
which is perhaps odd for the browser??.. but perhaps is a feature worth keeping.
bug or feature - mobile browser?
try again in mobile browser safe://hbyyyynw7fi7ko8u3wtai6eekko3m5y6u9ud7w1i4ajycmwfwu3wwpnn81
Still, odd perhaps the mobile browser doesn’t do the same with that null file and instead suggests “Error Page not found No such data exists.”… and I don’t know if that is an error where url does exist… it should show null?
bug safe cat
I’m also wondering that there’s something wrong with the way that safe cat works
These are different outputs where there surely should be consistency.
I wonder that safe cat is doing what safe files ls should be.
safe cat perhaps should be only for downloading and safe files ls ( == safe ls) only for listing.
for example try
safe cat safe://testk3
safe cat safe://hello
The first dumps the content, which is fine.
The second does a listing output because it happens there is nothing exactly at that location but there is content subordinate to it.
Edit: I’ve just logged this because thinking about it, it seems clear that cat=concatenate is being confused with ls=listing https://github.com/maidsafe/safe-api/issues/516