Doh! That was perhaps a stupid example, because of course
cwd already gives that exact result. The general question is
how to resolve *any* relative path.

Here's the situation:

The fmod module is now located in libs/fmod .

        libs/fmod/
                load.factor
                fmod.factor
                invtro94.s3m
                play-song.factor

What play-song.factor does is it plays invtro94.s3m
(a ScreamTracker3 music module) in FMOD.

What it wants to do is find the current module directory and append
"invtro94.s3m" to it, to form the absolute path:

        "D:\\Anton\\Dev\\Factor\\libs\\fmod\\invtro94.s3m"

which it will then pass to the FMOD function FMUSIC_LoadSong .

But I lack a way to find "the current module directory".

I would be happy with a way to find "the directory this file is in".
I would put the function in play-song.factor, and it would return:

        "D:\\Anton\\Dev\\Factor\\libs\\fmod"

Sorry about all the backslashes, I hate them too.

Anton.

> Sorry, perhaps I wasn't that clear.
> 
> I'd like, given a relative path, eg:
> 
>       "./"
> 
> to resolve it into the absolute path, eg:
> 
>       "D:/Anton/Dev/Factor/"
> 
> Regards,
> 
> Anton.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to