Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Check if an object exists
ResourceFunction["ObjectExistsQ"]["Register",head,test] registers test as the function to call for objects of Head head in ResourceFunction["ObjectExistsQ"]. |
Check if a PermissionsGroup exists:
In[1]:= |
Out[1]= |
Use CreatePermissionsGroup to create the group:
In[2]:= |
Now it exists:
In[3]:= |
Out[3]= |
Create a BoxObject and CellObject:
In[4]:= |
Out[4]= |
Both exist:
In[5]:= |
Out[5]= |
Both can be deleted with NotebookDelete:
In[6]:= |
In[7]:= |
Out[7]= |
In[8]:= |
In[9]:= |
Out[9]= |
Using ChannelObject does not actually create a channel:
In[10]:= |
Out[10]= |
Using CreateChannel makes the channel live:
In[11]:= |
In[12]:= |
Out[12]= |
Using CloudObject does not actually create a cloud object:
In[13]:= |
Out[13]= |
Using CloudPut or similar functions creates the object:
In[14]:= |
In[15]:= |
Out[15]= |
A DatabaseReference exists if it is backed by a file that exists or if it is connected:
In[17]:= |
Out[17]= |
In[18]:= |
Out[18]= |
External sessions exist while they are active:
In[19]:= |
Out[19]= |
In[20]:= |
Out[20]= |
Use DeleteObject to end the session:
In[21]:= |
Now, the session no longer exists:
In[22]:= |
Out[22]= |
For a LocalObject, ObjectExistsQ is equivalent to FileExistsQ:
In[25]:= |
Out[25]= |
Use Put to create the local object:
In[26]:= |
In[27]:= |
Out[27]= |
A NotebookObject exists only if the window has not been closed:
In[28]:= |
Out[28]= |
In[29]:= |
Out[29]= |
Closing the window destroys the NotebookObject:
In[30]:= |
In[31]:= |
Out[31]= |
Check if a PermissionsGroup exists:
In[32]:= |
Out[32]= |
Create the group with CreatePermissionsGroup:
In[33]:= |
Now it exists:
In[34]:= |
Out[34]= |
Using PersistentObject does not actually create a persistent object:
In[35]:= |
Out[35]= |
In[36]:= |
Out[36]= |
Assign a value to create the object:
In[37]:= |
Out[37]= |
Now it exists:
In[38]:= |
Out[38]= |
Check if a ResourceFunction exists:
In[39]:= |
Out[39]= |
In[40]:= |
Out[40]= |
Delete the resource:
In[41]:= |
In[42]:= |
Out[42]= |
Functions published in the Wolfram Function Repository always exist:
In[43]:= |
Out[43]= |
In[44]:= |
Out[44]= |
Check if a SearchIndexObject exists:
In[46]:= |
Out[46]= |
In[47]:= |
Out[47]= |
Delete the index:
In[48]:= |
In[49]:= |
Out[49]= |
A task only exists until it is complete:
In[50]:= |
Out[50]= |
In[51]:= |
Out[51]= |
Once completed, it no longer exists:
In[52]:= |
Out[52]= |
Test if an InputStream or OutputStream is open:
In[55]:= |
In[56]:= |
Out[56]= |
In[57]:= |
Out[57]= |
Close the stream:
In[58]:= |
Out[58]= |
In[59]:= |
Out[59]= |
Strings are either interpreted as URLs or files:
In[60]:= |
Out[60]= |
In[61]:= |
Out[61]= |
In[62]:= |
Out[62]= |
Unknown object types give False:
In[63]:= |
Out[63]= |
Register a new object type:
In[64]:= |
Out[64]= |
Now the specified function is used on the object type to determine whether it exists:
In[65]:= |
In[66]:= |
Out[66]= |
In[67]:= |
Out[67]= |
This work is licensed under a Creative Commons Attribution 4.0 International License