Page 1 of 1

nrn_load_dll file

Posted: Wed Apr 04, 2012 3:44 pm
by JimH
It seems that invalid file references in nrn_load_dll don't throw an error. Is this known/desired? It seems that if the user specifies a file that doesn't exist an error should be thrown ... Thoughts?

Thanks,
Jim

Re: nrn_load_dll file

Posted: Wed Apr 04, 2012 8:36 pm
by hines
The function returns 0 on failure, 1 on success.

Code: Select all

oc>nrn_load_dll("foo")
	0 
oc>nrn_load_dll("/home/hines/neuron/nrnmpi/share/nrn/demo/release/x86_64/.libs/
libnrnmech.so")
loading membrane mechanisms from /home/hines/neuron/nrnmpi/share/nrn/demo/release/x86_64/.libs/libnrnmech.so
Additional mechanisms from files
 cabpump.mod cachan1.mod camchan.mod capump.mod invlfire.mod khhchan.mod mcna.mod nacaex.mod nachan.mod release.mod
	1 
oc>


Re: nrn_load_dll file

Posted: Thu Apr 05, 2012 11:43 am
by JimH
Ah, good to know. I had never thought about it but I guess that's why a lot of the function calls I make are constantly printing out ones. Perhaps I should be paying more attention to those occasional zeros and removing some of those curly brackets around my function calls! Although on a related note, I just looked at some of my code and the one zero I was currently receiving was from a chdir() call in which 0 is good and -1 is bad :/

I tend to prefer throwing errors as opposed to status codes but I realize that the code isn't going to change. Thanks for giving me something to think about!