POSIX paths

The basics of how to develop, test, and use models.
Post Reply
melissamou
Posts: 38
Joined: Fri Aug 27, 2010 7:23 am

POSIX paths

Post by melissamou »

Hi Ted,
I have create a axon according to the cable.hoc in the example "http://senselab.med.yale.edu/modeldb/Sh ... \cable.hoc" and my main code is

Code: Select all

objref f, x_model, y_model, z_model
objref neurite
objref tvec,pvec,veclist


load_file("nrngui.hoc")
xopen("D:/home/Model2/my model/SetPara.hoc")
xopen("D:/home/Model2/my model/axon.hoc")
proc GetSL(){
      neurite=new SectionList()
      forall{
          neurite.append()
      }
        proc InitCell() {
            // Extracellular, all parameters are default values
 	forall insert extracellular
}

proc FindLoca() { local i,n		localobj x_comp,y_comp,z_comp
	localobj x_sect,y_sect,z_sect,len_sect,range

	x_model = new Vector()
	y_model = new Vector()
	z_model = new Vector()		
	forsec neurite {
		n = n3d()	
		x_sect = new Vector(n)
		y_sect = new Vector(n)
		z_sect = new Vector(n)
		len_sect = new Vector(n)
		
		for i = 0,n-1 {
			x_sect.x[i] = x3d(i)
			y_sect.x[i] = y3d(i)
			z_sect.x[i] = z3d(i)
			len_sect.x[i] = arc3d(i)	
		}
		len_sect.div(len_sect.x[n-1])			
		range = new Vector(nseg+2)
		range.indgen(1/nseg)  
		range.sub(1/(2*nseg))
		range.x[0] = 0
		range.x[nseg+1] = 1
		
		x_comp = new Vector(nseg+2)
		y_comp = new Vector(nseg+2)
		z_comp = new Vector(nseg+2)
		
		x_comp.interpolate(range, len_sect, x_sect)
		y_comp.interpolate(range, len_sect, y_sect)
		z_comp.interpolate(range, len_sect, z_sect)
		
		
                x_model.append(x_comp)
		y_model.append(y_comp)
		z_model.append(z_comp)
	}
// Write location information to files	
	f = new File("D:/NEURON/Model2/my model/coordinate/x_loca1.dat")
	f.wopen()
	x_model.vwrite(f)
	f.close()
	
	f = new File("D:/NEURON/Model2/my model/coordinate/y_loca1.dat")
	f.wopen()
	y_model.vwrite(f)
	f.close()
	
	f = new File("D:/NEURON/Model2/my model/coordinate/z_loca1.dat")
	f.wopen()
	z_model.vwrite(f)
	f.close()
}
     
          proc main(){
	GetSL()
	
	InitCell()
	
	FindLoca()

	}
main()

	quit()

however when i run the main file error happened:
loading membrane mechanisms from nrnmech.dll
Additional mechanisms from files
fh.mod
1
cygwin warning:
MS-DOS style path detected: D:/home/Model2/my model/SetPara.hoc
Preferred POSIX equivalent is: /cygdrive/d/home/Model2/my model/SetPara.hoc
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.h ... -pathnames
1
1
nrniv: syntax error
in /cygdrive/D/home/Model2/my model/main.hoc near line 19
proc FindLoca() { local i,n localobj x_comp,y_comp,z_comp
^
could you please explain what's the problem, i really have no idea.

thanks a lot
ted
Site Admin
Posts: 5795
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: POSIX paths

Post by ted »

It means that you should use POSIX paths instead of MSWin paths. If you don't understand paths, the differences between POSIX and MSWin paths, or the special directory structure used by Cygwin, read the documentation that the error message pointed you to. If you want to avoid having to deal with paths, just put all of the hoc, ses, mod, txt, dat etc. files that your model needs into one directory, and you'll be able to use file i/o commands without having to specify the path of the file. Please note the following:
1. The source code for Brill et al. 1977 (ModelDB accession number 9848) put all source code in the same directory, so it did not have to bother with paths.
2. Few NEURON models involve so much source code as to make complex directory architectures either useful or necessary. All too often, such architectures merely impede software development, debugging, and maintenance, and in some cases produce cross-platform incompatibilities that prevent code from running in all three common OS environments (MSWin, OS X, UNIX/Linux).
melissamou
Posts: 38
Joined: Fri Aug 27, 2010 7:23 am

Re: POSIX paths

Post by melissamou »

Dear Ted,
the warning now is solved but the error is also exist
nrniv: syntax error
in /cygdrive/D/home/Model2/my model/main.hoc near line 19
proc FindLoca() { local i,n localobj x_comp,y_comp,z_comp
ted
Site Admin
Posts: 5795
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: POSIX paths

Post by ted »

That's a different error message, isn't it. It would be appropriate to begin a new discussion thread that addresses this new error message.
Post Reply