Re: [AD] Finding the current directory path

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


On December 13, 2008, Colin Ward wrote:
> 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 ""?

because on any sane OS "." is "current directory". If your OS doesn't do it, 
its likely broken.

> --
> /-------------------------------------------------------------------\
> [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! ]
> \-------------------------------------------------------------------/
>
>
> ---------------------------------------------------------------------------
>--- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
> Nevada. The future of the web can't happen without you.  Join us at MIX09
> to help pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com
>/


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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