Re: [AD] Finding the current directory path

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


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

Depends on if Amiga wants to be compatible or not. They'll find it hard to get 
the user base they want without being at least a little compatible, and they 
had a chance since the new Amiga is pretty much brand new afaik.

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

Both are broken in many ways :P

> 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?

I'm honestly not sure. It might have some subtle differences on windows or 
unix.

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