exports.handler=function(event, context){
var exec = require('child_process').exec;
exec('./youtube-dl --version', function(error, stdout, stderr){
if(stdout){
console.log('stdout:'+stdout);
}
if(stderr){
console.log('stderr:'+stderr);
}
if(error!==null){
console.log('Exec error:'+error);
}
context.succeed(stdout);
});
};
Even if I want to change the execution permission, it seems that I don't have write permission, so I can't change it with chmod.
After copying the executable to a writable /tmp
chmod755 youtube-dl
If so, you can change the permissions and execute them, but it is inconvenient.
Can't I manage to run it in the same directory as the function?
(Comment transcription)
I solved myself. I could have done it if I had set the permission on the unix machine before compressing it to zip.
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
620 Uncaught (inpromise) Error on Electron: An object could not be cloned
917 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.