-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the way how extpipe path is verified #360
Comments
Any ideas? Am I correct that this code can be removed? |
Well I suspect it was added as people's extpipe's were failing in way that didn't make it clear what they had done wrong. We could (probably) switch to using access() instead I guess, to retain the behaviour: https://stackoverflow.com/questions/19598497/check-if-a-folder-is-writable (Though it may miss some cases like weird mis-configurations of NFS where the directory appears to exist and be writeable but we can't actually create a file in it.) |
PR created: #417 If path exists and is writable - silently continues as it was previously
If access denied:
|
Closing via #417 |
Please re-open issue. Pull-request #417 breaks extpipe when movie_filename is set to I've added additional logs to my motion code to show what I'm talking about. Motion config:
Logs:
Motion has access to /var/lib/motioneye/Camera1 directory, so does not create the 2017-08-08 directory, causing extpipe to fail. |
So you are using file name to create subdirectories? |
That is the default motioneye configuration. It would break extpipe for a lot of existing motioneye users if we change the behavior. I thought it's a legit way of grouping movies by date subfolder. Correct me if I'm wrong but I don't think it's hard to maintain the original behavior of creating subfolder. The line where we call access to check path, we include the subfolder in the path. What are your thoughts? |
Of course, we can make an additional hack to always create dir structure for whatever file name is. But this is wrong, do you agree? For example, ffmpeg or any other encoder won't create missing structure if you specify output file as "my/new/path/file.mp4" I would probably prefer to see subdirs in Since there may be more users affected I will try to make a temporary fix that will work in the old way, but it is better to bring the discussion about this behavior separately |
No, my solution won't work. A fix is needed to always create subdirs... |
I'm not saying which method is right or wrong, just for discussion sake. This configuration allows for more flexibility, for example:
Movies and pictures can go into separate directories. |
Yes, this makes sense. However, if you made a typo you will end up with unexpected dirs created in random places ;) |
PR created: #462 |
Can we change the way how extpipe verifies if the path is correct?
Currently it opens dummy file to check if the file opens fine:
https://github.com/Motion-Project/motion/blob/master/event.c#L557
There is some inconvenience with this way, for example, I use a script that monitors the specified directory and copies files to cloud backup. Sometimes randomly the script tries to upload that dummy file which is no longer exist and it generates an error.
Is there other "dry run" way to check if path is valid?
Do we need to validate it at all?
The text was updated successfully, but these errors were encountered: