Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Core - App.cpp - GetDataFile
Core - App.cpp - GetDataFile [message #3172] |
Tue, 09 May 2006 21:48 |
3togo
Messages: 83 Registered: May 2006 Location: Hong Kong SAR
|
Member |
|
|
I think that no matter exec program is running under posix or windows, GetDataFile should always get the current working directory(getcwd) and concat with *filename.
However, the present release behaves differently on these two different systems.
I suggest replace GetHomeDirectory() below with GetCWD()
String& GetCWD() {
char buffer[100];
int size = 100;
getcwd(buffer,size);
static String ss;
ss.Cat(buffer);
return ss;
}
Regards,
3togo
************************************************************
App.cpp
************************************************************ *
String GetDataFile(const char *filename)
{
String s = Environment().Get("UPP_MAIN__",
#ifdef PLATFORM_WIN32
GetFileFolder(GetExeFilePath())
#endif
#ifdef PLATFORM_POSIX
GetHomeDirectory()
#endif
);
return AppendFileName(s, filename);
}
[Updated on: Tue, 09 May 2006 22:03] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu Mar 28 21:51:26 CET 2024
Total time taken to generate the page: 0.01172 seconds
|