Permission denied

The basics of how to develop, test, and use models.
Post Reply
Gannier

Permission denied

Post by Gannier »

Hi all!

I'm using Neuron version 6.1.1 under vista

here is my problem :
When I save a group of window from the WindowGroupManager over an existing file sometime I get this message :

Code: Select all

oc>oc: Permission denied
nrniv: errno set during call of PWManager[0].save
 near line 143
 {PWManager[0].save("./nscca.ses", WindowGroup[1])}
and when I exit Neuron, the file is deleted
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Either you are (1) trying to write a file into a directory where you do not have write privileges,
or you are (2) trying to write a file that is "locked" because some other program is using it.
Example of (1): under WinXP, non-administrator users ordinarily cannot write to the root of
the boot drive (i.e. c:); the same is probably true under Vista. If this occurs, just save the
ses file in a directory where you do have write privileges.
Exampe of (2): this might happen if you open a ses file with a text editor, then try to use
NEURON to write the ses file again. If this occurs, either close and exit the text editor, or
save the ses file with a different name.
Gannier

Post by Gannier »

Hi Ted,

Thanks for you answer,
but I am sure that
- the file is not locked by another application
- I have all the rigths on the directory

I remember that similar thing happened under XP and with an precedent version of neuron

to reproduce this, could you try the next command under XP or vista:
- open a model (I've tried with some differents models with the same result)
- use menu : File-Load session
- open a file session with a group of windows
- use menu : Window-Group Manager
- select the group open in the session file
- use "save group" button
- save on the same session file
you get a message window : "filename.ses already exists: Write?"
- press "Go ahead"

then you get an error message in "nrniv window"
oc>oc: Permission denied
nrniv: errno set during call of PWManager[0].save
near line 141
{PWManager[0].save("./ci1.ses", WindowGroup[1])}
at this time, the size of this file is 0
and when you exit Neuron, this file is deleted

BUT if you open the session file in a "hoc" file with the load_file function
and then you save the group in a similar way, the file is saved without error message

this is why I think there is a bug in Neuron
I hope this could help you to find it easilly

Best regards
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

to reproduce this, could you try the next command under XP or vista:
- open a model (I've tried with some differents models with the same result)
- use menu : File-Load session
- open a file session with a group of windows
- use menu : Window-Group Manager
- select the group open in the session file
- use "save group" button
- save on the same session file
you get a message window : "filename.ses already exists: Write?"
- press "Go ahead"
I just tried this on my WinXP PC, which has NEURON 6.1.1 (1894) 2007-11-24 (I really must
update!). I see several annoying error messages, but the entire sequence of operations
that you describe seems to work, and the resulting ses files are valid and not empty.

Exactly what version of NEURON are you using, i.e. what is the complete first line that
appears in the rxvt window when NEURON starts?
Gannier

Post by Gannier »

I'm on a different place and with another PC under WinXP,

I loaded the last version found at https://www.neuron.yale.edu/neuron/install/install.html
version 6.1.2 (1927) 2007-12-30

I loaded a model from modeldb : http://senselab.med.yale.edu/modeldb/Sh ... odel=97863

I launched mosinit.hoc
in Group manager, I created a new group, added graph[0]
given it a name and saved it.
I exited Neuron then reloaded it by mosinit.hoc

in menu file-load session, I loaded the saved session file
in menu Window-GroupManager, I selected the group
and if you overwrite the same file you loaded you get a permission denied
yet you can overwrite another file (not loaded before) without error

More, I found an old version of neuron [ 6.0.4 (1819) 2007-07-20 ] with exactly the same behaviour
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

I launched mosinit.hoc
in Group manager, I created a new group, added graph[0]
given it a name and saved it.
I exited Neuron then reloaded it by mosinit.hoc

in menu file-load session, I loaded the saved session file
in menu Window-GroupManager, I selected the group
and if you overwrite the same file you loaded you get a permission denied
yet you can overwrite another file (not loaded before) without error
This reproduces the problem. It is much easier to demonstrate a similar, if not identical,
problem that occurs when one tries to save a particular filename.ses after one has
already opened a file of the same name during the current "session of using NEURON."
This is just a "feature" of MSWin--locking the file so that users can't overwrite their own
work. In Win 3.1 there was a way to prevent the OS from doing this, but I don't know how
to override this "nanny OS behavior" under WinNT, 2K, XP, or Vista.

"So what can I do" you may ask.
The workaround is simply to save the ses file with a different name. Then after you exit
NEURON, give the ses file whatever name you want. Or you might switch to UNIX/Linux,
which doesn't have this annoying behavior (I suspect that OS X doesn't have it either).
Gannier

Post by Gannier »

I am sorry to insist but I don't think this is due to the OS.
I developpe my own software in C and never encounter this kind of behaviour.

This happens only when you use the "load session" entry in the "File" menu but opening a session file with the load_file function in a hoc file or directly in the nrniv window doesn't exhibit such error: you can overwrite the same file.

Else, the file is empty before you exit Neuron, this indicates that the file can be writed and Neuron begins to write it so the problem seems to be elsewhere
Post Reply