summaryrefslogtreecommitdiff
path: root/gr-utils/src/python
diff options
context:
space:
mode:
authorTom Rondeau2012-12-12 18:45:53 -0500
committerTom Rondeau2012-12-12 18:45:53 -0500
commitf1de74af9270235126b67e9507111df5752a3e5c (patch)
tree61bb10c9a73d03d1e9016d9c2de84e6e2c28aeca /gr-utils/src/python
parent9ac98067a8529d80501ab3c8122b3ce11e896657 (diff)
downloadgnuradio-f1de74af9270235126b67e9507111df5752a3e5c.tar.gz
gnuradio-f1de74af9270235126b67e9507111df5752a3e5c.tar.bz2
gnuradio-f1de74af9270235126b67e9507111df5752a3e5c.zip
core: add new options to GRC for file_meta_sink.
Also updates gr_read_file_metadata to add a -D option that properly parses a detached header.
Diffstat (limited to 'gr-utils/src/python')
-rw-r--r--gr-utils/src/python/gr_read_file_metadata10
1 files changed, 7 insertions, 3 deletions
diff --git a/gr-utils/src/python/gr_read_file_metadata b/gr-utils/src/python/gr_read_file_metadata
index ba530ca54..efbf8d15d 100644
--- a/gr-utils/src/python/gr_read_file_metadata
+++ b/gr-utils/src/python/gr_read_file_metadata
@@ -26,7 +26,7 @@ from optparse import OptionParser
from gnuradio import gr
from gnuradio import parse_file_metadata
-def main(filename):
+def main(filename, detached=False):
handle = open(filename, "rb")
nheaders = 0
@@ -63,7 +63,9 @@ def main(filename):
extra_info = parse_file_metadata.parse_extra_dict(extra, info, True)
nheaders += 1
- nread += info['nbytes'] + parse_file_metadata.HEADER_LENGTH + info["extra_len"]
+ nread += parse_file_metadata.HEADER_LENGTH + info["extra_len"]
+ if(not detached):
+ nread += info['nbytes']
handle.seek(nread, 0)
print "\n\n"
@@ -73,6 +75,8 @@ if __name__ == "__main__":
parser = OptionParser(conflict_handler="resolve",
usage=usage, description=description)
+ parser.add_option("-D", "--detached", action="store_true", default=False,
+ help="Used if header is detached.")
(options, args) = parser.parse_args ()
if(len(args) < 1):
@@ -80,4 +84,4 @@ if __name__ == "__main__":
sys.exit(1)
filename = args[0]
- main(filename)
+ main(filename, options.detached)