1
$\begingroup$

You can create a Databin file like this:

This link can check you file.I found I couldn't change it's name after I create it.As the documemtation of RenameFile in Details and Options:

RenameFile works on cloud objects, changing their cloud file names but not their UUIDs.

So I guess it can do this.But how to do it?

$\endgroup$
  • $\begingroup$ @Xavier bin["Name"] can get its name,but it's invariable after use SetOptions.Strange behavior. $\endgroup$ – yode Sep 23 '16 at 12:20
  • $\begingroup$ @Xavier Wow,I can reproduce it.If you cancel you deletion.I will accept that. :) $\endgroup$ – yode Sep 26 '16 at 17:05
3
$\begingroup$

The name of a Databin

bin = CreateDatabin["Name" -> "FirstName"];

bin["Name"]
(* "FirstName" *)

can be changed with SetOptions:

SetOptions[bin, "Name" -> "LastName"];

The modification does not seem to be reflected when evaluating again the above:

bin["Name"]
(* "FirstName" *)

and the summary box also still displays the old name:

bin

enter image description here

It can be checked however that the change is indeed performed by going on the datadrop website:

  • before the evaluation of SetOptions:

enter image description here

  • after its evaluation and reloading the page:

enter image description here

Note that if we exit the kernel,

LocalSymbol["BinUUID"] = bin["UUID"];
Exit

and load the bin in a new session, we recover the new name:

bin = Databin[LocalSymbol["BinUUID"]]

enter image description here

Remove[LocalSymbol["BinUUID"]];

bin["Name"]
(* "LastName" *)

Update

Alternatively, all the cache related to the bin can be clear:

SetOptions[bin, "Name" -> "MiddleName"];

bin["Name"]
(* LastName *)

DownValues[DataDropClient`Private`datadropclientcache] = 
   With[{sid = bin["ShortID"], uuid = bin["UUID"]}, 
      DeleteCases[
        DownValues[DataDropClient`Private`datadropclientcache], 
        patt : HoldPattern[lhs_ :> rhs_] /; MemberQ[patt, sid | uuid , Infinity]
      ]
   ];

bin["Name"]
(* MiddleName *)

or the relevant part can be updated appropriately:

SetOptions[bin, "Name" -> "NoName"];

DataDropClient`Private`datadropclientcache[{"DatabinIDs", bin["UUID"]}] = 
     Options[bin][[1, 2]]

bin["Name"]
(* "NoName" *) 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.