Executing :mksession in vim generates error - vim

When i try and save a session using :mksession, i get the following error:
E190: Cannot open "Session.vim" for writing
I have checked the permissions for the current directory, and they are fine. (I can and have been saving my files to this directory.)
Anyone got any ideas?
I am using Gvim 64-bit , on the windows 7 os.
Thanks for any insight!
Russ

"Session.vim" seems to be created at the path of the current file you are editing.
If you are viewing a system file, in a directory where you don't have permission to write, it is likely that it won't work. If you want to be sure this is the case, try to launch vim with "sudo vim/sudo gvim" and check again if it works or not.

Related

How to use Neovim as External editor for Godot (Godot executable permissions)

I am trying to configure Godot to use launch Neovim in iTerm2 when I double click on a file containing code in the editor, however, a terminal window pops up instead with the following error:
/Users/myusername/.../Scripts/Player.gd; exit
zsh: permission denied: /Users/.../Scripts/Player.gd
This error message quickly goes away before I can read it and I am presented with an empty neovim window but it hasn't opened the file I clicked on. Additionally, the current working directory for the neovim window is my home directory (not the directory the project is based in)
I am running macOS Catalina with iTerm2 and Godot 3.2.2. My settings to open neovim in
Editor->Editor Preferences->Text Editor->External:
"exec path":iTerm2 executable (I tried pointing to the actual nvim executable, but that didn't seem to work).
exec flags: "nvim {file}".
My understanding is that this should open iTerm and execute the command "nvim [insert filename here]", opening Neovim.
I tried some solutions, including creating a neovim.desktop file, however, nothing seems to work. If anyone has any suggestions as to how I can give Godot the correct permissions I'd love to hear it. Please let me know if you need anything else.
Thank you!

Pumba installation - Command not found on linux terminal

I am trying to install pumba from the OS release page. Once it is downloaded, I try running
pumba --help
It gives a command not found error.
Can anyone suggest what am I missing? The amd_64 file has all read, write and execute permissions.
If the name of the file is pumba_linux_amd64, you have to use that. Additionally, since the file is (assuming) not in your $PATH, you can't launch it directly.
If your file is in your current directory, run
./pumba_linux_amd64

Node fs Error: EPERM: operation not permitted, open

I get this error in my app:
Error: EPERM: operation not permitted, open 'C:\Program Files
(x86)\Full Menu\db\main.json'
The app I have is built with electron-boilerplate. I am using this function to get the path to the root of the app:
path.dirname(process.execPath)
And this is the script that writes the file:
fs.writeFile(apath + '/db/' + elem + '.json', JSON.stringify(results)
I know what the problem is: permissions. But how could I get this working without running the app as an administrator?
For the benefit of searchers; I has this error. I added full permissions for Everyone as a test, but that didn't fix it. The issue was that the file was set to readonly (by source control).
Unchecking the readonly option in the file properties fixed the issue.
On my Windows 10 machine, I encountered this error when running an old Node JS project. I think Node version 10.16.
In any case, it was trying to modify a dotfile in my project. Be sure that the file isn't hidden on Windows. After unchecking the hidden option in the file properties pop up. Everything worked.
So to fix:
Right click file in Windows Explorer
Select properties
Uncheck Hidden
Click Ok
Re-run your command.
If you have the file that you can't open or modify mounted as a volume in docker restarting docker should fix the issue.
i had to run the node command prompt as administrator and that fixed the issue.
I face this issue when I was deleting a file/folder.
Solution:
Just restart your code editor/ terminal
Or
Restart your computer
If you are facing this issue on Windows 10, then please try the following:
Uncheck readonly options for the folder (if read-only reverts, login as administrator)
Open terminal as administrator (if you are facing this issue on terminal)
Switch off ransomware folder protection
Change chmod of the folder
Check if the folder is hidden or not
Disable antivirus protection (temporarily) and try this
Or move your project folder somewhere else, where antivirus ransomware protection is disable.
If nothing above works, then try the following:
https://appuals.com/how-to-fix-folder-keeps-reverting-to-read-only-on-windows-10/.
Hope this would of help.
I think that you must change the permissions recursively to the file so the user executing your script can read / write this file.
https://fr.wikipedia.org/wiki/Chmod
Restarting my computer fixed this problem for me.
I had this issue too. I'm using TFS (or VSO, Azure DevOps, etc.) for source control. I was trying to compile from .scss to .css and it couldn't open my .css. I just needed to right-click on my .css file and Check Out for Edit...
I had the error because i have already open the file before
var stream = fs.createWriteStream(outputFileName, {flags:'a'})
var output = fs.createWriteStream(outputFileName, {flags:'a'})
this is not an exact answer but may help:
i think if you want to read or readSync a file that doesn't exist you will encounter an EPERM error...
in many programming languages, any permission related error may not
directly means an actual permission issue
for example in PHP Folders (not files) must delete by php rmdir() method but if you want to do that with unlink() , u will encountered with a wrong Warning message that says "permission denied"
I was facing the same problem using the following software:
Windows 10
GitBash
Node v19
I was able to solve it opening GitBash as admin
I had the same problem, when i tried to create and write to a file using NodeJS. I thought it had to do with my windows file/folder access permissions, but after restarting my computer and running the code again, I still got the same error.
However, this time around my antivirus gave me a pop-up message also, stating that it blocked permission for Node.exe to write or open files. So once I flagged Node.exe as safe for my anti-virus program (Avast).
It worked for me. Disabling my antivirus could've also temporarily fixed it, I guess.
If you use windows 10, you must turn off Ransomware protection. Ransomware protection will prevent all folder and file changes.You can turn off it in Windows Security Center. See screenshot below:

Can't run .run file using cygstart

I am trying to run a .run file in cygwin, but I always seem to get this error:
Unable to start '~.run': There is no application associated with the given file name extension.
I needed to be a superuser, so I tried using the command: cygstart --action=runas "$#"
I read somewhere that cygstart is for invoking registered Windows handler, so this may be the problem, but I am unsure. Is there any way that I can run my .run file as a superuser using cygwin?
Well, as has been said, no application is associated with .run files on your
system. So you can do that one of two ways
Call the file with the program, example
cygstart notepad.exe ~.run
Tell the registry what to do with unknown extensions
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Unknown]
#=""
[HKEY_CLASSES_ROOT\Unknown\shell\Open\command]
#="notepad.exe \"%1\""
This question is not related to Cygwin but rather to Windows. cygstart works the same as Windows' start. That means, if you use [cyg]start file.extension it works very similarly as if you double-click on that file in Windows Explorer.
Therefore if you configure Windows to do what you need when you double-click on your *.run file, cygstart will work fine too.
I think that easier is to use appropriate extension which Windows already knows. It depends on what you have inside your *.run file. If it's executable, use exe extension, if it's batch script, use cmd or bat, if it's JavaScript, use js etc.
If you use Linux or some derivation, you need to execute the .run file with an absolute path, even if you have already navigated to the appropriate directory containing the file. See here:
http://the-chronicon.blogspot.com/2011/08/execute-run-file-in-current-folder-from.html

"Could not open input file" crons error

There are a few other questions on Stack Overflow about this and I do understand that, but none of them are giving me an idea of why im getting the "Could not open input file".
I have it setup so I get an email everytime a crons runs (im using cPanal to set the crons) but all I get is:
Could not open input file: /home/methodjs/classified/emailNotifications.php
Because is the first time i'm using crons jobs I have no idea what this means or how fix it.
My command line is:
/usr/local/bin/php $HOME/classified/emailNotifications.php
Am I doing something wrong? Thanks for any help. By the way, i'm sure thats the right path to PHP because thats what I got from my host.
ensure file is located here:
/home/methodjs/classified/emailNotifications.php
try to execute from commandline:
/usr/local/bin/php /home/methodjs/classified/emailNotifications.php
what appears?
ensure your php file has execution rights
chmod 755 /home/methodjs/classified/emailNotifications.php
The error appears either file is not present at given path or proper permission are not set for file. It can be checked by navigating to path and ll for checking permission.
All,
This problem started occurring on all my 20 Kubuntu machines after an update from Ubuntu! Since Ubuntu is Debian based not sure if Debian or Ubuntu is to blame, so investigating!
Debian users, if this is also impacting you please reply so we can investigate further!
Cheers!

Resources