Re: [AD] Finding the current directory path

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 13/12/2008, you wrote:
> 
>> 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 ""?
>
> because on any sane OS "." is "current directory". If your OS doesn't
> do it, its likely broken.

Amiga OS predates Windows, Linux and Mac OS.  Mabye it is they that are
broken?

Is VMS broken as well for using strange paths?  Or Mac OS <= 9?

The fact is that some operating systems are different.  Now does anyone have
any suggestions about how to support this case genrically?  Is there a
reason why we can't just change the "./" to "" in this case?

-- 
/-------------------------------------------------------------------\
[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! ]
\-------------------------------------------------------------------/





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/