>> So the direction is to store data into '$HOME/.hbide/'
>> on *nix and to store such data in '%APPDATA%\hbide\'
>> dir on Windows systems.
>> 
>> Of course it's always a good thing to allow for 
>> "portable" installation (f.e. on USB drives), 
>> where app and data resides in the same directory 
>> structure, and currently this is exactly what 
>> hbide support. The problem is that's the only 
>> method it supports.
>> 
> 
> I am ageing, so missed a point to mention in previous post.
> 
> hbIDE already supports the location of .ini files if user supplies it as 
> first parameter to it :
>   hbide.exe $HOME/_some_user_folder_/hbide.ini
> 
> For Windows I always run hbIDE from destop-icon(s) pointing to 
> different locations of hbide.ini.
> 
> Other files, viz., hbide.skl, hbide.scu and hbide.env inherits from 
> such location if not set their location explicitly.
> 
> However I never tried with %AppData% like variables, but in theory 
> these should be respected by OS, no.

Sorry, but I can't see what you mean by "respected".
You can read them using GETENV( "APPDATA" ).

While the cmdline configuration option you mention above 
is nice, it's still not a solution to this problem.

Instead IMO you could do something like this:

FUNCTION DetectIniPath()

   IF ! hb_FileExists( hb_dirBase() + "hbide.ini" )
   #if defined( __PLATFORM__WINDOWS )
      RETURN GetEnv( "APPDATA" ) + "\hbide\" 
   #elif defined( __PLATFORM_UNIX )
      RETURN GetEnv( "HOME" ) + "/.hbide/"
   #endif
   ENDIF

   RETURN hb_dirBase()

And use the returned path as the base path for 
hbide.ini, .viz and the rest.

For the project base dir (and other default user 
directories), you should use GetEnv( "HOME" )
on *nix and GetEnv( "HOMEDRIVE" ) + GetEnv( "HOMEPATH" ) 
for Windows.

Viktor

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to