discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Relative Path to File with File Sink/Source


From: Marcus D. Leech
Subject: Re: [Discuss-gnuradio] Relative Path to File with File Sink/Source
Date: Mon, 16 Mar 2015 14:30:48 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 03/16/2015 02:10 PM, Richard Bell wrote:
Hmmm. That means I have to specify the directory users must start grc from to keep from erroring out?

Rich
This a very generic Linux thing.  Nothing to do with GRC or Gnu Radio specifically.  When you hand the operating system a relative path, it is
  interpreted in the context of the current directory.  That is uniformly true.

If that "doesn't work for you", you can always come up with a little wrapper script that places your user process in the desired directory before
  starting the actual thing you're wanting to run.



On Mon, Mar 16, 2015 at 10:59 AM, Marcus Müller <address@hidden> wrote:
You're probably not running the script from where the .py is, but from where GRC started. Relative paths are relative to that folder.
That means that if you run gnuradio-companion from your home directory (which is probably the default when you just open it from some menu), then paths are relative to /home/user1.

Greetings,
Marcus


On 03/16/2015 06:51 PM, Richard Bell wrote:
Easy question here. I'm trying to use a relative path with file sink/source. It errors out with "can't open file".


I'm assuming the path is relative to the location of the .grc file location.

If the location of the .grc file was: /home/user1/proj1/devel/myfile.grc
And a data file was here: /home/user1/proj1/dat/datafile.dat
Then the path I use in file source is: ../dat/datafile.dat

What do I need to change to make this work?

Thanks,
Rich


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]