TextFile and Outer Environment
Importing / Exporting Contents
The contents of textfile can be imported or exported from / to a ** file on the disk.
Import and Export From a Box
To import or export a contents :
-
Ctrl
/ right click on the textfile box -
choose
Import Contents from File
orExport contents to File
in the contextual menu -
choose a file and directory in the dialogue window.
—|—
The imported file appears in the textfile box and in the buffer.
—|—
Import or Export from the Editor
-
To import contents from an external file to the open text editor, select
File / Import From...
-
To export contents, select
File / Savec As...
External File Attachment
Other options allow to attach the object permanently to an external file on the disk .
From the TextFile Box
- To fill textfile with the contents of a persistent file, Ctrl / right click on the box, select
Import and Attach File
. - To save the contents of textfile in an external file, select
Export and Attach File
.
These option are alike “Import” and “Export” options, but they link the content of the object with a file on the hard drive of the computer.
—|—
With a File Pathname
To initialize a textfile with a file :
-
enter the name of a file in the “self” input of an infile , outfile or tempfile box
-
connect the output of the box to the “self” input of the textfile box.
The textfile is then attached to the corresponding file.
Connecting a pathname to TextFile
—|—
About Pathnames
Example : Reading a Pathname
When a box returns a pathname , this pathname can be visualized via a textfile box.
The editsco function from the OM2Csound userlibrary writes a text file - a Csound score - and returns the file pathname.Zoom
Removing Attachements
To remove a link to a file, select Free Attached File
.
This option is only available if the textfile is already attached to a file. Once the attached file is is “freed”, the contents of the textfile is internalized in the patch.
—|—
File Modification
Save Command
Inputting data via “exp-list” on append mode.
To modify an attached file :
-
input data via the “exp-list” input
-
evaluate the box
-
from the text editor, press
cmd
+s
to store the modifications in the box.
When the object is saved, the related file on the hard drive is modified as well.
—|—
Externalized Contents
The attached file has been deleted. The Listener displays an error message.
Contrary to the “import” and “export” options, the attach
option implies
that the textfile object itself refers to a persistent file. Hence, its
content won’t be stored int the patch itself.
-
Parallel modifications of the attached file will affect the textfile box’s content.
-
If the attached file is deleted of moved, the textfile will be empty when the patch is reloaded.
—|—
References :
Contents :
- OpenMusic Documentation
- OM User Manual
- Introduction
- System Configuration and Installation
- Going Through an OM Session
- The OM Environment
- Visual Programming I
- Visual Programming II
- Basic Tools
- Curves and Functions
- Array
- TextFile
- TextFile Edition
- Outer Environment
- Picture
- Score Objects
- Maquettes
- Sheet
- MIDI
- Audio
- SDIF
- Lisp Programming
- Errors and Problems
- OpenMusic QuickStart