Henrik Nordstrom wrote:
I am not very fond of the format. Would prefer

refresh_pattern min [unit] pct max [unit]

I was about to have a bash at this using strsep instead of strtok to parse the refresh_pattern as strsep allows you to test the next token as well as the current token. This way you can check for optional tokens like the units will be. strsep however is not as portable as strtok, it's not in solaris for example, so we would need to include a test for strsep and provide it if there is no system version. Does this seem reasonable ?

The code for calculating the seconds based on unit size is already in cache_cf.c function parseTimeUnits, so this bit should be fairly straight forward.

--
Michael

Reply via email to