I want to rename a local file. And I try to use "fs-ops-move" node but it shows that permission denied.
Is there any other way to rename the local file? Thanks in advance!
I want to rename a local file. And I try to use "fs-ops-move" node but it shows that permission denied.
What OS is node red running on?
If you login as that user can you rename the file?
What file is it?
I run node-red on Linux.
And I just want to add the suffix ".mp4" at the end of the file name to change the file type.
If you want help you must try and answer the questions asked. I will try again, in a different way.
Login as the user that runs node red and rename the file using the command line. Copy/paste the result, including the line where you enter the command.
Also show us how you have configured the node and show us the message you are sending to the node to do the rename.
A thought, though. I assume that you are providing the full path to the file. If not then do that.
The most likely cause of permission denied is that the Node-red user does not have write permission to the target directory.
ls -ld /etc
drwxr-xr-x 109 root root 12288 Nov 28 11:00 /etc
cd /etc
mv /home/pi/testfile try.mp4
mv: cannot move '/home/pi/testfile' to 'testfile.mp4': Permission denied
Make certain that you are targetting the right directory by using full pathnames.
cd /etc
mv /home/pi/testfile /home/pi/testfile.mp4
echo $?
0 # Success
You could use an exec node sudo mv /full/path/to/testfile /full/path/to/testfile.mp4 but probably end up with an mp4 file that you can't access.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.