I have reinstalled and installed Ubuntu 3 times now. I'm writing a gforth program for the school. I have installed gforth and it runs just fine. I've written a file to save my program in. In the given directory and I use ls, the file is listed. However, if I use the command gforth filename.fs, I get *OS command line*:-1: No such file or directory followed by a few lines of a backtrace. Trying to include the file while in gforth creates a similar result. Even when I try vim filename.fs, I get a blank file. Creating new files with vim also doesn't work. After I exit vim and save, the file is nowhere to be found. Please help.

  • You sure you didn't put a space or similar invisible character in the filename? – muru Sep 11 '18 at 2:59
  • Yeah, the filename has no spaces or anything, it's literally program.fs – ScottyD Sep 11 '18 at 3:11
  • Are you in the same directory as the file when you call gforth ? Try gforth ./program.fs – Sergiy Kolodyazhnyy Sep 11 '18 at 3:35
  • That resulted in almost the exact same thing, except instead of saying No such file or directory it now says Permission denied. I thought I've been running as the administrator, but I don't know if that even has anything to do with this. – ScottyD Sep 11 '18 at 3:38
  • Go to the directory and run namei -lx *, and add the output please. – muru Sep 11 '18 at 3:52

The output of namei shows what the problem is: your file exists, but has permissions ----------, meaning it is neither readable, writable nor executable by anyone, including the user who owns the file. Try:

chmod u+rw program.fs

The command ls -l program.fs should then show something like

 -rw------- 1 username username 0 Nov 22 14:21 program.fs

The rw means that you have given yourself permission to read and write this file. See e.g. https://www.tutorialspoint.com/unix/unix-file-permission.htm for more info.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.