Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

Conversation

@PaulWay
Copy link

@PaulWay PaulWay commented Oct 13, 2016

Hi there!

I've added an option and associated code for having fswebcam check and create the components of the path it's writing files to. This is useful for when writing e.g. time lapses into date-named directories, and a new day starts while fswebcam is running.

@PaulWay
Copy link
Author

PaulWay commented Oct 16, 2016

BTW, I tested this and it worked on new invocation but not when left running and moving into a new day. I'll trace this down.

* Start from position 1 in string (no use looking at zero length paths)
* Break if we hit the end of string (last part must be filename)
* Better replacement of / in path.
* Message if creating a directory.
@PaulWay
Copy link
Author

PaulWay commented Oct 19, 2016

Hi there! I've tested this and it's now working :-)

@PaulWay
Copy link
Author

PaulWay commented Oct 26, 2016

I found a minor annoyance where it would say it was creating a directory with the same name as the filename (although, for reasons I don't entirely understand, it didn't actually create that directory). I fixed that by only looking at the 'directories' part of the path, ignoring the filename at the end. I've tested this and it works.

@fsphil
Copy link
Owner

fsphil commented Oct 28, 2016

Hi Paul,

You could do this now with the --exec command, for example:

$ fswebcam --loop 60 --exec "mkdir -p /timelapse/%Y-%m-%d" --png 6 /timelapse/%Y-%m-%d/%H-%M-%S.png

I do like the idea of a flag for it though, seems tidier. I'll try and get a look at it soon.

@PaulWay
Copy link
Author

PaulWay commented Oct 29, 2016

On 28/10/16 22:17, Philip Heron wrote:

Hi Paul,

You could do this now with the --exec command, for example:

|$ fswebcam --loop 60 --exec "mkdir -p /timelapse/%Y-%m-%d" --png 6
/timelapse/%Y-%m-%d/%H-%M-%S.png|

I do like the idea of a flag for it though, seems tidier. I'll try and get a
look at it soon.

Hey, Phil! Sorry, I was going to write to you this weekend and see if you'd
seen the merge request :-)

I did think about that but I think it's so much simpler to have a single
option to do that, especially as people may already need the exec call for
something else.

Anyway, thanks for getting back to me. Hope this helps!

Have fun,

Paul

@PaulWay
Copy link
Author

PaulWay commented Sep 6, 2022

Just updated to the current version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants