[AD] Finding the current directory path |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Hi all.
I have a small but oft recurring problem with my Allegro port, which is to
do with the current directory.
Often this is assumed by Allegro to be "./" which works on Unix and I
believe also on Windows. However, on the Amiga this doesn't work - the
current directory is simply "". So trying to open a file such as
"./allegro.cfg" will fail.
I have changed a couple of files in Allegro to strip out this ./ prefix for
now, but I was wondering if anyone had any suggestions on how to do this
more generically. Is there any actual need for Allegro to use ./ even on
Unix? A good example of this is in file.c:pack_fopen_chunk() on line 1987
where it has the comment:
/* Give up - try current directory */
Any reason why it strdup()'s "./" and not ""?
--
/-------------------------------------------------------------------\
[Hitman/Code HQ - 6502/z80/68000/604e/80x86/ARM coder - Amiga rulez!]
[VZ-200/VIC-20/MZ-700/c16/c64*10/c128*8/Plus-4/CPC464/CD32/500*2 ]
[600/1000/1200*2/A4000/SNES/N64/Dreamcast/Athlon 1100/AmigaOne ]
[Assembly Language: The most fun you can have with your clothes on! ]
\-------------------------------------------------------------------/