Writing Binary Files
The File Sink block takes incoming samples and saves them to local storage.
Block Options for Data Types
By default the File Sink block uses a 32-bit float format for saving interleaved I and Q:
Opening the block's properties, other formats can be selected from the drop down menu:
Another common type is float, represented by orange, which stores real samples as 32-bit floats.
Data may also be stored as 16-bit integers using the short type. Both real and complex samples may be stored with this type, which will be discussed later in this tutorial.
The path can also be entered directly as a text string:
[[File:Storing_binary_files_file_extension_example.png
The File Sink also has a File parameter which needs to be defined. Click on the three dots:
On Ubuntu a window will appear which will allows navigation to different directories so the file can be saved. The file can be saved anywhere, including the home directory although for this example it is saved in /opt/tutorials and the output filename is binary_file.
Note that by default a file sink uses the Overwrite function, meaning each time the flowgraph is run the binary file in that location will be replaced by all of the new samples. The Append function is described later in this tutorial.