help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wait until the file is done


From: Mike Jonkmans
Subject: Re: wait until the file is done
Date: Fri, 30 Oct 2020 19:30:02 +0100

On Fri, Oct 30, 2020 at 11:10:18AM -0700, Russell Lewis wrote:
> Question, then an idea:
> 
> Q:
> Any reason to use wc -c over ls -al?  Is one worse or better, or are they
> more or less the same?  Maybe ls output requires more parsing?

Parsing ls output is not such a good idea.
I have seen scripts break when ls' output changed.
E.g. when the '+' character came into play.

> Idea:
> Instead of checking file size every thirty seconds and trying to be
> precise, you could just wait 10m at a time, and terminate when you see
> *any* window with no change.  Worst case, you end up waiting 19.99 minutes,
> but that's probably acceptable for this application.

Larger intervals leads to more energy use.
But so does frequent polling.

Regards, Mike Jonkmans

-- 
Mike Jonkmans <bashbug@jonkmans.nl>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]