“No such file or directory” even though the file is listed with ls











up vote
3
down vote

favorite












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.










share|improve this question
























  • You sure you didn't put a space or similar invisible character in the filename?
    – muru
    Sep 11 at 2:59










  • Yeah, the filename has no spaces or anything, it's literally program.fs
    – ScottyD
    Sep 11 at 3:11










  • Are you in the same directory as the file when you call gforth ? Try gforth ./program.fs
    – Sergiy Kolodyazhnyy
    Sep 11 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 at 3:38










  • Go to the directory and run namei -lx *, and add the output please.
    – muru
    Sep 11 at 3:52















up vote
3
down vote

favorite












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.










share|improve this question
























  • You sure you didn't put a space or similar invisible character in the filename?
    – muru
    Sep 11 at 2:59










  • Yeah, the filename has no spaces or anything, it's literally program.fs
    – ScottyD
    Sep 11 at 3:11










  • Are you in the same directory as the file when you call gforth ? Try gforth ./program.fs
    – Sergiy Kolodyazhnyy
    Sep 11 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 at 3:38










  • Go to the directory and run namei -lx *, and add the output please.
    – muru
    Sep 11 at 3:52













up vote
3
down vote

favorite









up vote
3
down vote

favorite











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.










share|improve this question















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.







command-line permissions






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 11 at 7:04









NIMISHAN

83521119




83521119










asked Sep 11 at 2:54









ScottyD

161




161












  • You sure you didn't put a space or similar invisible character in the filename?
    – muru
    Sep 11 at 2:59










  • Yeah, the filename has no spaces or anything, it's literally program.fs
    – ScottyD
    Sep 11 at 3:11










  • Are you in the same directory as the file when you call gforth ? Try gforth ./program.fs
    – Sergiy Kolodyazhnyy
    Sep 11 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 at 3:38










  • Go to the directory and run namei -lx *, and add the output please.
    – muru
    Sep 11 at 3:52


















  • You sure you didn't put a space or similar invisible character in the filename?
    – muru
    Sep 11 at 2:59










  • Yeah, the filename has no spaces or anything, it's literally program.fs
    – ScottyD
    Sep 11 at 3:11










  • Are you in the same directory as the file when you call gforth ? Try gforth ./program.fs
    – Sergiy Kolodyazhnyy
    Sep 11 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 at 3:38










  • Go to the directory and run namei -lx *, and add the output please.
    – muru
    Sep 11 at 3:52
















You sure you didn't put a space or similar invisible character in the filename?
– muru
Sep 11 at 2:59




You sure you didn't put a space or similar invisible character in the filename?
– muru
Sep 11 at 2:59












Yeah, the filename has no spaces or anything, it's literally program.fs
– ScottyD
Sep 11 at 3:11




Yeah, the filename has no spaces or anything, it's literally program.fs
– ScottyD
Sep 11 at 3:11












Are you in the same directory as the file when you call gforth ? Try gforth ./program.fs
– Sergiy Kolodyazhnyy
Sep 11 at 3:35




Are you in the same directory as the file when you call gforth ? Try gforth ./program.fs
– Sergiy Kolodyazhnyy
Sep 11 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 at 3:38




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 at 3:38












Go to the directory and run namei -lx *, and add the output please.
– muru
Sep 11 at 3:52




Go to the directory and run namei -lx *, and add the output please.
– muru
Sep 11 at 3:52










1 Answer
1






active

oldest

votes

















up vote
1
down vote













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.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1074139%2fno-such-file-or-directory-even-though-the-file-is-listed-with-ls%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    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.






    share|improve this answer

























      up vote
      1
      down vote













      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.






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 22 at 18:26









        Peter Selinger

        262




        262






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1074139%2fno-such-file-or-directory-even-though-the-file-is-listed-with-ls%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How did Captain America manage to do this?

            迪纳利

            南乌拉尔铁路局