Three levels of file system
- Ivan Denisov
- Posts: 363
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Krasnoyarsk, Russia
Three levels of file system
With BlackBox you can have working directory (/USE), that is a kind of union mount technology over hosting OS.
However often BlackBox users extensively patching and extending framework with subsystems, so there are troubles with upgrading standard version.
To solve this issue F.V. Tkachov suggested to make third directory.
After the discussion we came to names:
STANDARD CUSTOM USE
Now you can put all your extensions (sybsystems, localization and patched files) into the CUSTOM directory.
With 1.8 you can try how it works.
https://blackbox.oberon.org/download
However often BlackBox users extensively patching and extending framework with subsystems, so there are troubles with upgrading standard version.
To solve this issue F.V. Tkachov suggested to make third directory.
After the discussion we came to names:
STANDARD CUSTOM USE
Now you can put all your extensions (sybsystems, localization and patched files) into the CUSTOM directory.
With 1.8 you can try how it works.
https://blackbox.oberon.org/download
Re: Three levels of file system
I test my program DosAbout on this version and get the system and the user directory.
How to get the custom directory in an application program?
How to get the custom directory in an application program?
Re: Three levels of file system
Without any change list plus the missing entry in the source header
e.g. HostFiles
- 20210116, bbcb, #045, restore Files interface to 1.6
- 20210517, bbcb, #0xx, Three levels of file system
It is difficult to find all changes and I need a very long time to proof them.
I have the following comments to the MODULE HostFiles in the version 1.8:
(1)
PROCEDURE NewLocator
the parenthesis is missing in line
IF (i > 1) & (loc.path[i-1] = "/") OR (loc.path[i-1] = "\") THEN loc.path[i-1] := 0X END;
correct is
IF (i > 1) & ((loc.path[i-1] = "/") OR (loc.path[i-1] = "\")) THEN loc.path[i-1] := 0X END;
(2)
Your implementation of move back to 1.6 is wrong. The correct move back to 1.6 is
(3)
I have not done the proof of "Three levels of file system" yet.
I don't understand why you use first & and second or in the line
IF ((res = fileNotFoundErr) OR (res = pathNotFoundErr)) & (isUseDir & isCustomDir) THEN
GetCustomDir(loc, fname);
and
IF ((res = fileNotFoundErr) OR (res = pathNotFoundErr)) & (isUseDir OR isCustomDir) THEN
GetStartupDir(loc, fname);
Sorry, it is a long way to a new version.
- Helmut
e.g. HostFiles
- 20210116, bbcb, #045, restore Files interface to 1.6
- 20210517, bbcb, #0xx, Three levels of file system
It is difficult to find all changes and I need a very long time to proof them.
I have the following comments to the MODULE HostFiles in the version 1.8:
(1)
PROCEDURE NewLocator
the parenthesis is missing in line
IF (i > 1) & (loc.path[i-1] = "/") OR (loc.path[i-1] = "\") THEN loc.path[i-1] := 0X END;
correct is
IF (i > 1) & ((loc.path[i-1] = "/") OR (loc.path[i-1] = "\")) THEN loc.path[i-1] := 0X END;
(2)
Your implementation of move back to 1.6 is wrong. The correct move back to 1.6 is
Code: Select all
PROCEDURE (f: File) NewWriter (old: Files.Writer): Files.Writer;
VAR w: Writer;
BEGIN (* portable *)
ASSERT(f.state # closed, 20);
IF f.state # shared THEN
IF (old # NIL) & (old IS Writer) THEN w := old(Writer) ELSE NEW(w) END;
IF w.base # f THEN
w.base := f; w.buf := NIL; w.SetPos(f.len)
END;
RETURN w
ELSE
RETURN NIL
END
END NewWriter;
I have not done the proof of "Three levels of file system" yet.
I don't understand why you use first & and second or in the line
IF ((res = fileNotFoundErr) OR (res = pathNotFoundErr)) & (isUseDir & isCustomDir) THEN
GetCustomDir(loc, fname);
and
IF ((res = fileNotFoundErr) OR (res = pathNotFoundErr)) & (isUseDir OR isCustomDir) THEN
GetStartupDir(loc, fname);
Sorry, it is a long way to a new version.
- Helmut
- Ivan Denisov
- Posts: 363
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Krasnoyarsk, Russia
Re: Three levels of file system
Now it is impossible. We are discussing, what need to be done for it is be possible. No there is no way in Files to get text representation of locator.Zinn wrote:I test my program DosAbout on this version and get the system and the user directory.
How to get the custom directory in an application program?
I suggested in 2.0 to add prefix system and new procedure
Code: Select all
Files.dir.This('custom:').GetPath*(OUT path: ARRAY OF CHAR)
The same for use
Code: Select all
Files.dir.This('use:').GetPath*(OUT path: ARRAY OF CHAR)
Code: Select all
Files.dir.This('standard:').GetPath*(OUT path: ARRAY OF CHAR)
- Ivan Denisov
- Posts: 363
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Krasnoyarsk, Russia
Re: Three levels of file system
No. You provided text for realization with the fix of Ilya Ermakov. After discussion, we decided not apply Ilya fix, because it leads to later error detection. So we just fixed the documentation.Zinn wrote: (2)Your implementation of move back to 1.6 is wrong. The correct move back to 1.6 is
This is the version from 1.6:
Code: Select all
PROCEDURE (f: File) NewWriter (old: Files.Writer): Files.Writer;
VAR w: Writer;
BEGIN (* portable *)
ASSERT(f.state # closed, 20); ASSERT(f.state # shared, 21);
IF (old # NIL) & (old IS Writer) THEN w := old(Writer) ELSE NEW(w) END;
IF w.base # f THEN
w.base := f; w.buf := NIL; w.SetPos(f.len)
END;
RETURN w
END NewWriter;
- Ivan Denisov
- Posts: 363
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Krasnoyarsk, Russia
Re: Three levels of file system
If USE set, BlackBox tries to open the file from the USE dir first.Zinn wrote:(3)
I have not done the proof of "Three levels of file system" yet.
I don't understand why you use first & and second or in the line
IF ((res = fileNotFoundErr) OR (res = pathNotFoundErr)) & (isUseDir & isCustomDir) THEN
GetCustomDir(loc, fname);
and
IF ((res = fileNotFoundErr) OR (res = pathNotFoundErr)) & (isUseDir OR isCustomDir) THEN
GetStartupDir(loc, fname);
If CUSTOM set and USE not set, BlackBox tries to open the file from the CUSTOM dir first.
So, the first "&" we need to check CUSTOM dir after fail in USE dir.
The second "OR" we need to check STANDARD dir after fail in CUSTOM dir or in USE dir, if there is no CUSTOM dir set.
Re: Three levels of file system
Is this proposal accepted by the community?Ivan Denisov wrote: I suggested in 2.0 to add prefix system and new procedureSo it will be possible to get locator in custom directory and then extract it's text representation. Do you like this idea.Code: Select all
Files.dir.This('custom:').GetPath*(OUT path: ARRAY OF CHAR)
The same for useand for standard directoriesCode: Select all
Files.dir.This('use:').GetPath*(OUT path: ARRAY OF CHAR)
Code: Select all
Files.dir.This('standard:').GetPath*(OUT path: ARRAY OF CHAR)
Does a sample implementation already exist?
Or do still look for another solution?
What about the discussion to have some procedure in Dialog to get the path info?
e.g.
PROCEDURE Dialog.GetSystemDir (OUT dir: ARRAY OF STRING);
PROCEDURE Dialog.GetCustomDir (OUT dir: ARRAY OF STRING);
PROCEDURE Dialog.GetWorkingDir (OUT dir: ARRAY OF STRING);
Normal programs should not depend on this information.
- Ivan Denisov
- Posts: 363
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Krasnoyarsk, Russia
Re: Three levels of file system
There is no sample implementation yet. The discussion continues, however it is paused for now.
About your suggestion. I do not think, that this three layers is essential in the interface layer. This multi-layer directories structure is not simple to be the basis of BlackBox, so it should be hidden in the "Host" realization. The locator allows to make it elegant way with prefixes.
Ilya suggested more universal way. He thinks that there should be messages interface in Files for File and for Locator. So there will be Message to query desired information about paths...
The discussion continues.
There is the new loop for the discussion of Unicode in 1.8 version. Few days ago Boris forced the idea for elimination if Unicode module. He put all the code to the Strings module now. I am reviewing his changes in the dev18 branch now.
About your suggestion. I do not think, that this three layers is essential in the interface layer. This multi-layer directories structure is not simple to be the basis of BlackBox, so it should be hidden in the "Host" realization. The locator allows to make it elegant way with prefixes.
Ilya suggested more universal way. He thinks that there should be messages interface in Files for File and for Locator. So there will be Message to query desired information about paths...
The discussion continues.
There is the new loop for the discussion of Unicode in 1.8 version. Few days ago Boris forced the idea for elimination if Unicode module. He put all the code to the Strings module now. I am reviewing his changes in the dev18 branch now.
- Ivan Denisov
- Posts: 363
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Krasnoyarsk, Russia
Re: Three levels of file system
The paths "STANDARD:" and "CUSTOM:" now have experimental support in BlackBox 2.0
https://blackbox.oberon.org/
https://blackbox.oberon.org/
Re: Three levels of file system
In the description on page https://blackbox.oberon.org/download about Ubuntu/Mint/Debian repository for automatic upgrades version 1.8 the line
echo "deb http://deb... is double one with 18 and one without.
Where can I find the description about 2.0? Are you working in the way to merge BB Windows & BB Linux?
Is the new not MDI version the new standard?
echo "deb http://deb... is double one with 18 and one without.
Where can I find the description about 2.0? Are you working in the way to merge BB Windows & BB Linux?
Is the new not MDI version the new standard?