An RSF “file” typically consists of 2 parts: the binary file, where data values are stored, and the header file (text), where data attributes are put (see RSF file format page for more details). To prepare such file for distribution, it is recommended to 1) make the binary part architecture independent so that data can be downloaded on heterogeneous computer systems, and 2) pack the binary and header parts. Such result is achieved by using the sfdd program to convert the binary part to XDR format and, at the same time, to pack the two parts. See the example below.

Example:

bash$sfspike n1=100 n2=100 >myfile.rsf bash$ sfin myfile.rsf
myfile.rsf:
in="/tmp/myfile.rsf@"
esize=4 type=float form=native
n1=100         d1=0.004       o1=0          label1="Time" unit1="s"
n2=100         d2=0.1           o2=0          label2="Distance" unit2="km"
10000 elements 40000 bytes

The binary part of myfile.rsf is in the DATAPATH, i.e. /tmp, and format is native. To make myfile.rsf easy to fetch from your FTP server, run the following command

bash$<myfile.rsf sfdd form=xdr out=stdout >xdr_packed_file.rsf bash$ sfin xdr_packed_file.rsf
xdr_packed_file.rsf:
in="stdin"
esize=4 type=float form=xdr
n1=100         d1=0.004       o1=0          label1="Time" unit1="s"
n2=100         d2=0.1           o2=0          label2="Distance" unit2="km"
10000 elements 40000 bytes


The file is now packed, i.e. in=”stdin”, and format is xdr. It is ready to go!
On the receiver side, i.e. computer which fetches this xdr_packed_file.rsf from your FTP server, it is recommended to start by unpacking and converting to native format the file before manipulating the data. This operation is also done using the sfdd program. The command is

bash\$ <xdr_packed_file.rsf sfdd form=native >myfile.rsf