Server configuration 'Home' path

Usage of the framework, compiler and tools
User avatar
Ivan Denisov
Posts: 362
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Server configuration 'Home' path

Post by Ivan Denisov »

For Ubuntu I suggest you to put one script in the folder:

/home/amcintosh/.local/share/nautilus/scripts

Code: Select all

#!/bin/sh
wine '/home/amcintosh/project/bb7-rc1/blackbox-canonical/BlackBox.exe' -use "`winepath -w "$PWD"`" $* &
Also this script should be executable.

With that script you can run BlackBox from any project folder.
runScript.png
luowy
Posts: 87
Joined: Thu Dec 17, 2015 1:32 pm

Re: Server configuration 'Home' path

Post by luowy »

we known file path has two mode:"absolute" and "relative", same as, BB's has "absolute" and "relative" Files.Locator also .
when you new a Locator like:

Code: Select all

loc:=Files.dir.Locator("d:\dir\dir2");
the loc is a absolute Locator;when you do:

Code: Select all

loc:=Files.dir.This("Obx\Mod");
the loc is relative Locator; for relative loactor, the current path is client path.

the dirty file opend with absolute locator always saved at it's origin path(Server/Client);
but the dirty file opened with rlelaive locator always saved at client path;
and the sub locator

Code: Select all

subloc:=loc.This("dir"); 
the subloc's mode same as parent loc always.

BB framework often open file(doc) use realtive locator mode, but this is not always, depend on the "path" form you given,
e.g. HostCms.Open(file: ARRAY OF CHAR), when you do

Code: Select all

StdCmds.OpenDoc("Obx\Mod\Views2")
is relative,it first search client path,if not find,search sever path(shadow) again. when the doc saved on dirty, it save to client path.
if you do

Code: Select all

StdCmds.OpenDoc("D:\a.txt");
that is absolute locator,ignore server/client path at all.

I have a litte knowledge about linux,ckeck Ivan's suggestion about your question .
Josef Templ
Posts: 262
Joined: Tue Sep 17, 2013 6:50 am

Re: Server configuration 'Home' path

Post by Josef Templ »

It is probably worth to consider the export of the startup directory from HostFiles in 1.7.1.
This would be a trivial change and it would not introduce any unwanted side effects
on Locators.

- Josef
luowy
Posts: 87
Joined: Thu Dec 17, 2015 1:32 pm

Re: Server configuration 'Home' path

Post by luowy »

Josef Templ wrote:It is probably worth to consider the export of the startup directory from HostFiles in 1.7.1.
This would be a trivial change and it would not introduce any unwanted side effects
on Locators.

- Josef
In my private HostFiles, I have exported three path variable: appPath(server),workPath(client),startPath;
1,appPath is the blackbox.exe file path, server path we call it; "startupDir" is it's origin name.
2,workPath is /USE path, if no the parameter,same as appPath
3,startPath is bat file path, it often same as workPath, /USE .
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Server configuration 'Home' path

Post by Robert »

Josef Templ wrote:It is probably worth to consider the export of the startup directory from HostFiles in 1.7.1.
I'd vote for that.
Josef Templ
Posts: 262
Joined: Tue Sep 17, 2013 6:50 am

Re: Server configuration 'Home' path

Post by Josef Templ »

Just for my understanding:

what are the typical situations the startupDir (or other dirs)
are required for?

- Josef
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Server configuration 'Home' path

Post by Robert »

Terminology:

Simple Installation:
- homePath: Something like "D:\BlackBox" which contains BlackBox.exe & all the SubSystems.
Typically D is a local drive.
- serverPath: Same as homePath.

Client/Server Installation:
- serverPath: Something like "K:\...\BlackBoxServer" which contains BlackBox.exe, all the Oms SubSystems, library SubSystems, and common project SubSystems.
Typically K is a network drive.
- homePath: Something like "D:\BlackBoxClient" which only contains private variants of common facilities (Menus, etc), and SubSystems specific to a confidential project.

Some of my colleages work with a Simple local BlackBox insttallation, some with a networked Client / Server installation.

Many projects have project specific data in a common format, which is typically kept in a file like: <BlackBoxPath>\ThisProjectSubSystem\DataA.xyz


To access this data we just type "ThisProjectSubSystem\DataA" into a Tool which deals with it accordingly.
The Tool has to be able to add <BlackBoxPath> to find the file.
It first tries "<homePath>\ThisProjectSubSystem\DataA.xyz". If this fails it gets <serverPath>, and if this differs from <homePath> looks there.

My current code for obtaining these two paths is:
homePath:

Code: Select all

 home  :=  Files.dir.This ('')(HostFiles.Locator).path$
serverPath:

Code: Select all

PROCEDURE  Server* (OUT home : ARRAY OF CHAR);
  VAR
    res, k  :  INTEGER;
  BEGIN
    res  :=  WinApi.GetModuleFileNameW (0, home, LEN (home));
    k  :=  LEN (home$);
    WHILE (k > 0) & (home [k] # '\')
                  & (home [k] # '/') & (home [k - 1] # ':')  DO  DEC (k)  END;
    home [k]  :=  0X    
  END  Server
Josef Templ
Posts: 262
Joined: Tue Sep 17, 2013 6:50 am

Re: Server configuration 'Home' path

Post by Josef Templ »

Robert wrote: The Tool has to be able to add <BlackBoxPath> to find the file.
Isn't this added anyway when you look up a file?
In other words, what is "The Tool" doing with startupDir that is not done
by BlackBox automatically?

- Josef
Josef Templ
Posts: 262
Joined: Tue Sep 17, 2013 6:50 am

Re: Server configuration 'Home' path

Post by Josef Templ »

Robert, is the special feature of your lookup tool that it turns
the specified relative path into an absolute path
so that when you later store the file it is not stored in homeDir
but at the place where it came from?

- Josef
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Server configuration 'Home' path

Post by Robert »

Josef Templ wrote:Robert, is the special feature of your lookup ...
One example: I know that the file is
"<Path to BlackBoxServer - which needs to be found at run time>\ProjectA\Diagrams\Image_1.png"

I need (I think) to create this full path to pass to the FreeImage interface procedure "FreeUtils.Load" to get a Bitmap handle that I can use to access the image.

So, using only the information "ProjectA\Diagrams\Image_1.png" I want to create this full path when:
1 - I am using a simple installation
2 - I am using the server side of a client/server installation
3 - I am using the client side of a client/server installation
Post Reply