Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: "Context sensitive" default file name when saving settings

Re: "Context sensitive" default file name when saving settings

From: Jens Arnold <jens_at_jens-arnold.net>
Date: Thu, 09 Jul 2009 00:19:59 +0200

On 01.07.2009, pondlife wrote:

>>> pondlife, I may be wrong but I think adding the leading
>>> zero to numbers < 10 is standard convention? A bit like
>>> how music tracks are always numbered track01, track02...

> Fair enough, although that convention makes most sense for
> tracks ripped from CD where 99 is the max track number.

> In this case, I don't see a logical reason to limit us to
> 100 settings (00-99), although I doubt anyone would
> actually generate that many files!

Fyi: create_numbered_filename() isn't limited to two digits -
the number of digits is a parameter, which is just set to 2 for
config files. For recordings it is set to 4 on targets w/o RTC.

And even if it's set to 2 that doesn't mean you're limited to
100 files. The number is formatted using a printf format
string.
In current code there is a problem that will cause the check for
the largest existing number to break if the number of digits is
exceeded, but this should be easily fixable. After that, we
could just specify a single digit wherever we don't want the
leading zeros.

The leading zeroes help with proper sorting though, without
needing the so-called "natural" sorting...

Regards, Jens
Received on 2009-07-09


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa