In Linux, on an extremely long running vim session, calls to system() fail with E484 “can't open file /tmp/”

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
6
down vote

favorite
1












I've noticed this only on long running vims in my Linux server. I've narrowed down the E484s to lines of my vimscript that call system.



I just wonder if there is a way to deal with this because so far i have just been closing and restarting vim if this happens. But since the problem is so specific, it would be nice if it could be addressed so i can continue to use the running instance.



It's tricky to test and iterate on this because it takes at least 3 weeks before a vim instance gets into this state.







share|improve this question
























    up vote
    6
    down vote

    favorite
    1












    I've noticed this only on long running vims in my Linux server. I've narrowed down the E484s to lines of my vimscript that call system.



    I just wonder if there is a way to deal with this because so far i have just been closing and restarting vim if this happens. But since the problem is so specific, it would be nice if it could be addressed so i can continue to use the running instance.



    It's tricky to test and iterate on this because it takes at least 3 weeks before a vim instance gets into this state.







    share|improve this question






















      up vote
      6
      down vote

      favorite
      1









      up vote
      6
      down vote

      favorite
      1






      1





      I've noticed this only on long running vims in my Linux server. I've narrowed down the E484s to lines of my vimscript that call system.



      I just wonder if there is a way to deal with this because so far i have just been closing and restarting vim if this happens. But since the problem is so specific, it would be nice if it could be addressed so i can continue to use the running instance.



      It's tricky to test and iterate on this because it takes at least 3 weeks before a vim instance gets into this state.







      share|improve this question












      I've noticed this only on long running vims in my Linux server. I've narrowed down the E484s to lines of my vimscript that call system.



      I just wonder if there is a way to deal with this because so far i have just been closing and restarting vim if this happens. But since the problem is so specific, it would be nice if it could be addressed so i can continue to use the running instance.



      It's tricky to test and iterate on this because it takes at least 3 weeks before a vim instance gets into this state.









      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 6 at 15:05









      Steven Lu

      962315




      962315




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          8
          down vote



          accepted










          This happens when some system cron job cleans out "unused" files from /tmp. The solutions are:



          1. Find that cron job and stop it from rm'ing your Vim /tmp files.


          2. Recreate Vim's temporary directory.


          Given the temporary directory name from the error message, you can recreate the directory manually with "!mkdir <dirname>", or you can use this command which you can put in your ~/.vimrc:



          command! Mktmpdir call mkdir(fnamemodify(tempname(),":p:h"),"",0700)


          That command was contributed to the vim_use list by Ben Schmidt.






          share|improve this answer






















          • This is wonderful, exactly the kind of manual workaround i need, thanks!
            – Steven Lu
            Aug 6 at 18:29










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "599"
          ;
          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: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f17019%2fin-linux-on-an-extremely-long-running-vim-session-calls-to-system-fail-with%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          8
          down vote



          accepted










          This happens when some system cron job cleans out "unused" files from /tmp. The solutions are:



          1. Find that cron job and stop it from rm'ing your Vim /tmp files.


          2. Recreate Vim's temporary directory.


          Given the temporary directory name from the error message, you can recreate the directory manually with "!mkdir <dirname>", or you can use this command which you can put in your ~/.vimrc:



          command! Mktmpdir call mkdir(fnamemodify(tempname(),":p:h"),"",0700)


          That command was contributed to the vim_use list by Ben Schmidt.






          share|improve this answer






















          • This is wonderful, exactly the kind of manual workaround i need, thanks!
            – Steven Lu
            Aug 6 at 18:29














          up vote
          8
          down vote



          accepted










          This happens when some system cron job cleans out "unused" files from /tmp. The solutions are:



          1. Find that cron job and stop it from rm'ing your Vim /tmp files.


          2. Recreate Vim's temporary directory.


          Given the temporary directory name from the error message, you can recreate the directory manually with "!mkdir <dirname>", or you can use this command which you can put in your ~/.vimrc:



          command! Mktmpdir call mkdir(fnamemodify(tempname(),":p:h"),"",0700)


          That command was contributed to the vim_use list by Ben Schmidt.






          share|improve this answer






















          • This is wonderful, exactly the kind of manual workaround i need, thanks!
            – Steven Lu
            Aug 6 at 18:29












          up vote
          8
          down vote



          accepted







          up vote
          8
          down vote



          accepted






          This happens when some system cron job cleans out "unused" files from /tmp. The solutions are:



          1. Find that cron job and stop it from rm'ing your Vim /tmp files.


          2. Recreate Vim's temporary directory.


          Given the temporary directory name from the error message, you can recreate the directory manually with "!mkdir <dirname>", or you can use this command which you can put in your ~/.vimrc:



          command! Mktmpdir call mkdir(fnamemodify(tempname(),":p:h"),"",0700)


          That command was contributed to the vim_use list by Ben Schmidt.






          share|improve this answer














          This happens when some system cron job cleans out "unused" files from /tmp. The solutions are:



          1. Find that cron job and stop it from rm'ing your Vim /tmp files.


          2. Recreate Vim's temporary directory.


          Given the temporary directory name from the error message, you can recreate the directory manually with "!mkdir <dirname>", or you can use this command which you can put in your ~/.vimrc:



          command! Mktmpdir call mkdir(fnamemodify(tempname(),":p:h"),"",0700)


          That command was contributed to the vim_use list by Ben Schmidt.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 6 at 21:00

























          answered Aug 6 at 16:42









          garyjohn

          4,639913




          4,639913











          • This is wonderful, exactly the kind of manual workaround i need, thanks!
            – Steven Lu
            Aug 6 at 18:29
















          • This is wonderful, exactly the kind of manual workaround i need, thanks!
            – Steven Lu
            Aug 6 at 18:29















          This is wonderful, exactly the kind of manual workaround i need, thanks!
          – Steven Lu
          Aug 6 at 18:29




          This is wonderful, exactly the kind of manual workaround i need, thanks!
          – Steven Lu
          Aug 6 at 18:29












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f17019%2fin-linux-on-an-extremely-long-running-vim-session-calls-to-system-fail-with%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          White Anglo-Saxon Protestant

          Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

          One-line joke