Page 1 of 1

Shared files & Closed files

PostPosted: Sat Nov 25, 2017 4:59 pm
by Zinn
With issue-#22 we have add the procedures Shared() and Closed() to the Files interface.
Who have used the new procedure Shared() in the application program?
Who have used the new procedure Closed() in the application program?
Does exist a useful sample for using them?
- Helmut

Re: Shared files & Closed files

PostPosted: Sat Dec 02, 2017 10:54 am
by Zinn
Nobody seems to care ...
Why I ask? Because BlackBox is incompatible between the Center and the Core solution.

B01: Files: HostFiles.NewWriter "returns" Trap 21 instead of NIL
https://forum.oberoncore.ru/viewtopic.php?t=1948
https://forum.oberoncore.ru/viewtopic.php?t=6169

Issue-#22: HostFiles.NewWriter violating the specification
https://forum.blackboxframework.org/viewtopic.php?t=77
https://redmine.blackboxframework.org/issues/22
https://forum.blackboxframework.org/viewtopic.php?t=170

According to the specification (System/Docu/Files) in case of read-only files NewWriter should return NIL. The current implementation, however, generates a TRAP.

The Oberon Core solution (B01) aligned the implementation (HostFiles) with the specification (Files).

The Center solution (Issue-#22) aligned the specification (Files) with the implementation (HostFiles). In order to be able to avoid the TRAP, two new File methods (Shared() and Closed()) should be introduced that return the file's current state.

So what? Which way would you like to follow?

You may have a look at http://www.zinnamturm.eu/downloads.htm

- Helmut

Re: Shared files & Closed files

PostPosted: Sun Dec 03, 2017 10:44 pm
by Josef Templ
The center has discussed this issue extensively and there were no signs that the
chosen approach is unacceptable to oberoncore.

Actually, the center approach is very simple and systematic and IMHO superior:
It is not possible to open a writer on a closed file: results in a TRAP 20.
It is not possible to open a writer on a shared file: results in a TRAP 21.

In order to avoid a TRAP 20 you can check for Closed().
In order to avoid a TRAP 21 you can check for Shared().

- Josef

Re: Shared files & Closed files

PostPosted: Tue Dec 05, 2017 2:52 pm
by Zinn
Currently I analyse OberonCore's latest BlackBox version build at 30.11.2017 and figure out what Core changed.
Some differences between Core and Center are incompatible and the Core has also some new futures.
For the 1st point look at https://forum.oberoncore.ru/viewtopic.php?t=6169
- Helmut

Re: Shared files & Closed files

PostPosted: Tue Dec 05, 2017 9:11 pm
by Josef Templ
Zinn wrote:Currently I analyse OberonCore's latest BlackBox version build at 30.11.2017 and figure out what Core changed.
Some differences between Core and Center are incompatible and the Core has also some new futures.
For the 1st point look at https://forum.oberoncore.ru/viewtopic.php?t=6169
- Helmut


The practical relevance of the semantical difference is close to zero, I think.
Also the practical relevance of the binary incompatibility of symbol files between the
oberoncore and the center version is close to zero.

The introduction of Closed() and Shared() did not introduce an avoidable binary incompatibility
in the step from 1.6 to 1.7 because of other unavoidable interface changes.
It also completes the Files.File interface so that there are no interface changes because of that extension to be
expected in the future. It would be very strange to introduce an avoidable binary incompatibility
now by removing it again.

In general, if there are no bigger differences then we have achieved a lot, together.

- Josef