Re: [AD] Hashes bite back |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Thu, 2004-01-01 at 17:26, Eric Botcazou wrote:
> > Allegro's magic `#' in filenames prevents anything with hashes in
> > the filename to be loaded. AFAIK this doesn't affect DOS/Windows
> > because these characters are disallowed in file names. It is a
> > problem under Linux.
>
> Is it really a problem? One of Allegro's primary goals is to be portable, so
> one could argue that you shouldn't be trying to load a file with such a
> filename with Allegro in the first place.
>
> > Possible solution: add a new function which enables/disables the
> > magical meaning of hashes in filenames, with the default behaviour
> > being the current one.
>
> Please, no more weird functions like this :-)
>
As I see it, the only really problematic case would be when someone uses
the file selector, e.g. in the grabber, and tries to load a file with
hashes. E.g. the user Bob tries to read an animation with 100 frames
from a read-only network partition, and the files are called anim#1.bmp
anim#2.bmp... in this case, the file selector passes back a filename
from which it knows that it won't work.
So maybe there's a way to escape hashes? The file selector, or probably
better the directory listing functions, would escape the #, and the file
routines would recognize additionally to the # also the escaped #.
The problem is - filenames in linux can contain any character - so is
there a way to escape #? Maybe ## means a literal #, # is the special
function.
--
Elias Pschernig <elias@xxxxxxxxxx>