Question:
Does anyone recognize this error I encountered/fixed while compiling FORTRAN on a Mac?
Floyd
2010-04-21 20:44:37 UTC
I installed XCode, gfortran, Fink, and gnuplot on my Mac a few days ago and had to go through hell to get it to work. I remember encountering several errors and figuring out how to fix them, and now it works perfectly. I'm trying to write up a brief tutorial on how to install all of these and make them work on a Mac for one of my teachers, but I can't remember what a specific error was.

I remember that when I tried to run something from the Terminal application (I may have been installing something or I may have been trying to compile something.. I can't remember), I got an error saying that some file was in mode #### (some 4-digit number number.. I feel like it had a 6 in it) and it needed to be in some other number. I googled the error, and an exact match came up, but I can't for the life of me remember what I googled or what the error was. I don't save a history on my computer, so I'm screwed in that regard.

I do remember how I fixed it, though. I navigated to the file (I don't remember which file it was haha.. sorry) and changed the access permissions to random values until I finally got it to compile. Each time I would change the access permissions, I would get a new #### mode that the file was in. I tried looking through a bunch of files' access permissions to see one with wacky permissions, but there are hundreds if not thousands of files in these directories, and I have to finish this report by the end of the week haha.

Does this error sound familiar to anyone? I know I didn't give a lot of detail, but maybe by some freak chance of nature someone will recognize this. Any help? Thanks!
Three answers:
Vincent G
2010-04-23 10:00:24 UTC
"Sudoers" seems to imply the sudo (super user do) utility that exists in UNIX/Linux (and since the latest MacOS is Linux based... well you get the picture).



Any file has access code, a binary combination of 1 (execute), 2 (write) and 4 (read), for a value that can range between 0 and 7. Each digit, in turn, applies to user, member of the group, and any user (or process). It seems that a terminal application would require to be accessible to read modification (since it is intended to receive information from other applications), but the exact details of what is actually needed probably depends on the specific terminal application itself.



Long story short, you need to change the access code of the file associated with the application. The command to do so is "chmod" (for CHange MODe). You could change the file access code by using the + and - modifier, but a much better way is to use the code itself; and since the OS was kind enough to tell you which value is needed, then it is just a matter of entering



chmod 0440 filename



I am not too familiar with MacOS, but somewhat comfortable with Linux and UNIX, and there is a feature that allows you to define the default access setting of newly created files (masks).



If you need to search a large directory for files with a specific access code, the you can use the "ls" command and pipe the result in a "grep" that will only select those matching the access code (which would be shown as "rwx" triplets, with any unactivated toggle sows as a hyphen instead, i.e. rw-). The "find" command will also allow search based on access code (-perm).



Check the attached reference link for details on the file permission and access codes.
2016-04-14 10:07:25 UTC
I took your code, compiled it and found the error that kept it from compiling & executing. Your data statement for nextMonth needs to have an "8" added after the "4" since that is the only number that you are missing. Once that is fixed and you recompile, you should get output that looks like: October April July
2010-04-21 20:52:45 UTC
It sounds as if the file was read-only and you had to change it to be writable. I don't know MacOSX, but it's probably a 3 digit number. Can't help you with which file it was, though.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...