Menu

#1 remove mac os absolute path name bug

open
5
2009-02-20
2009-02-20
No

pwd is built up on the posix command getcwd() which return the current working directory, that means this will most likely be

/home/christian/webdav/Projekte/src/

when is start the game with ./bin/game

but we would want it to return

/home/christian/webdav/Projekte/src/bin/

even when i start it with ./bin/game

more important it really also should

return/home/christian/webdav/Projekte/src/bin/

even if i started it with a symbolic link from /usr/bin

the only platform independent method seems to be, to use a hardcoded path in a config file that is created on installation, but thats extremely ugly because we dont really plan to create an installer Christian Goltz <r0flcopter>

Thursday 02/05/2009 at 10:53, comment #3:

maybe take a look at the standard unix call "pwd" ? Thomas Prescher <gonzo>

Tuesday 02/03/2009 at 23:41, comment #2:

totally agree on inheriting the new interface from the unix one. but as a consequence we will end up with having a unix interface with a virtual getAbsolutePath() and a mac os interface and linux interface implementing it because the method we use at the moment is not unix compatible and should go into those seperate classes.

this one looks like a solution too:
http://lists.apple.com/archives/Dar... Christian Goltz <r0flcopter>

Tuesday 02/03/2009 at 23:21, comment #1:

figured out, why getAbsolutePath() doesn't work: there is no /proc on mac os.
a method that could work is explained here: http://www.oroboro.com/rafael/docse... .put testing that on my todo list - but if it works, a new class MacInterface could inherit from UnixInterface, right? seems that most of the current code works on both os and we wouldn't duplicate code that way. Jana Traue <battled>

Friday 01/30/2009 at 14:17, original submission:

method to get relative path in mac os may not work with our unix interface.
method in the interface is named getAbsolutePath() and should ever return the path were the executable is located and not the path where the user started the program from. we need this because we use relative path names in collection and environment files.
maybe find another method to get the path that works on all unix or split the unix interface into mac os and linux.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB