Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Export data to a file, creating intermediate directories as necessary
ResourceFunction["EnsureExport"]["path/dest.ext",expr] exports data to a file, creating the directories in path if they don’t already exist. | |
ResourceFunction["EnsureExport"]["path/dest.ext",…] exports data to a file using the same arguments as Export. |
Export data to a file in a directory that doesn’t already exist:
In[1]:= |
Out[1]= |
In[2]:= |
Out[2]= |
EnsureExport accepts the same arguments and options as Export:
In[3]:= |
Out[4]= |
When the depth of the specified path is zero, ExportToPath behaves exactly like Export:
In[5]:= |
Out[5]= |
Export fails if the specified path is in a nonexistent directory:
In[6]:= |
Out[6]= |
EnsureExport creates directories that don’t exist:
In[7]:= |
Out[7]= |
EnsureExport, like Export, will fail if the current user has insufficient permissions to write to the specified path:
In[8]:= |
Out[8]= |
This work is licensed under a Creative Commons Attribution 4.0 International License