Reply to topic  [ 3 posts ] 
occasional and curious error with rdfile 
Author Message

Joined: Wed May 14, 2008 10:05 am
Posts: 4
Location: Brasil
Post occasional and curious error with rdfile
Hello Forum,
I am having trouble using some of the rdfile functions; specifically, when I ask Yorick to open and read two columns of data and then place them in an array called 'signal' more or less as follows (I have omitted a few lines initializing the array):

require, "rdfile.i"; // include rdfile

n = read(open("helium/scope_9_1"), time, signal) / 2; /* NOTE the divide by 2 open and read file*/

signal=signal(1:n); // fill array

The curious thing is that sometimes the program compiles and sometimes it does not. (More recently, though, it has refused to compile, which is why I'm posting.) The error message says '(rdfile) cannot open file helium/scope_9_1 (mode r)'. But why not, since the file is in the right directory and it did so in the past? Perhaps the code is too sloppy and should be written more formally. However, I have no idea how to clean it up.
I'm using Yorick 1.5-14 on Windows XP, though the same problem occurs with the later version Yorick 2.1.04. I hope I have explained my troubles clearly enough. Any help would be much appreciated.

Regards,
Ricardo


Sat Mar 19, 2011 7:48 pm
Profile
Yorick Guru

Joined: Thu May 10, 2007 12:07 pm
Posts: 62
Post Re: occasional and curious error with rdfile
It is a bit hard to help from what you wrote.
But I noticed:
1) You are using a relative path to your file, make sure that yorick is in the root path (with command "cd") or put directly an absolute path. This i maybe why sometime it did not find the file.
2) given your code, You do not need to include rdfile.i (I do not know what it is anyway).


I do not know what you mean by "compile" since yorick is interpreted and nothing "compile" ?

Hope it help, Cheers,
Sylvain.


Mon Mar 21, 2011 9:28 pm
Profile
Yorick Master

Joined: Mon Nov 22, 2004 9:43 am
Posts: 354
Location: Livermore, CA, USA
Post Re: occasional and curious error with rdfile
I think Sylvain has it exactly right: Sometimes you are in the correct working directory, and sometimes you are not. You can find out your current working directory by typing (at the yorick prompt):
Code:
get_cwd()

To change your current working directory, use the yorick cd function. For a more complete description, check out the help for cd and the functions it references in its "SEE ALSO" section:
Code:
help,cd


Sun Apr 03, 2011 9:33 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.