Editing
Guide to RSF file format
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Datapath=== How did the RSF program (<tt>sfmath</tt>) decide where to put the data file? In the order of priority, the rules for selecting the data file name and the data file directory are as follows: #Check <tt>--out=</tt> parameter on the command line. The parameter specifies the output data file location explicitly. #Specify the path and the file name separately. #*The rules for the path selection are: #*#Check <tt>datapath=</tt> parameter on the command line. The parameter specifies a string to prepend to the file name. The string may contain the file directory. #*#Check <tt>DATAPATH</tt> environmental variable. It has the same meaning as the parameter specified with <tt>datapath=</tt>. #*#Check for <tt>.datapath</tt> file in the current directory. The file may contain a line <pre> datapath=/path/to_file/ </pre> or <pre> machine_name datapath=/path/to_file/ </pre> if you intend to use different paths on different platforms. #*#Check for <tt>.datapath</tt> file in the user's home directory. #*#Put the data file in the current directory (similar to <tt>datapath=./</tt>). #*: #*The rules for the filename selection are: #*#If the output RSF file is in the current directory, the name of the data file is made by appending \@. #*#If the output file is not in the current directory or is created temporarily by a program, the name is made by appending random characters to the program's name and selected to be unique. Examples: <pre> bash$ sfspike n1=10 --out=test1 > spike.rsf bash$ grep in spike.rsf in="test1" </pre> <pre> bash$ sfspike n1=10 datapath=/tmp/ > spike.rsf bash$ grep in spike.rsf in="/tmp/spike.rsf@" </pre> <pre> bash$ DATAPATH=/tmp/ sfspike n1=10 > spike.rsf bash$ grep in spike.rsf in="/tmp/spike.rsf@" </pre> <pre> bash$ sfspike n1=10 datapath=/tmp/ > /tmp/spike.rsf bash$ grep in /tmp/spike.rsf in="/tmp/sfspikejcARVf" </pre> ====Packing header and data together==== While the header and data files are separated by default, it is also possible to pack them together into one file. To do that, specify the program's "<tt>--out</tt>" parameter as <tt>--out=stdout</tt>. Example: <pre> bash$ sfspike n1=10 --out=stdout > spike.rsf bash$ grep in spike.rsf Binary file spike.rsf matches bash$ sfin spike.rsf spike.rsf: in="stdin" esize=4 type=float form=native n1=10 d1=0.004 o1=0 label1="Time" unit1="s" 10 elements 40 bytes bash$ ls -l spike.rsf -rw-r--r-- 1 sergey users 196 2004-11-10 21:39 spike.rsf </pre> If you examine the contents of <tt>spike.rsf</tt>, you will find that it starts with the text header information, followed by special symbols, followed by binary data. Packing headers and data together may not be a good idea for data processing, but it works well for storing data: it is easier to move the packed file around than to move two different files (header and binary) together while remembering to preserve their connection. Packing the header and data together is also the current mechanism used to push RSF files through Unix pipes.
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information