Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Core - App.cpp - GetDataFile
icon13.gif  Core - App.cpp - GetDataFile [message #3172] Tue, 09 May 2006 21:48 Go to previous message
3togo is currently offline  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

 
Read Message icon13.gif
Read Message
Read Message
Read Message
Read Message
Previous Topic: TrayIcon for linux
Next Topic: how to listnen to File System Events?
Goto Forum:
  


Current Time: Mon Jul 06 05:33:49 CEST 2020

Total time taken to generate the page: 0.01201 seconds