Does anybody know, how to solve this problem ?
Thanks Christian
P.S. Sorry, my english is not so good, it is not my native language.
--
+============================================================================+
| Name: Christian Andretzky >:::::::::::::::::< |
| Institute: TU Chemnitz, Fachbereich Maschinenbau III >:::::::::::::::::< |
| Room: Reichenhainer Str. 70, Zi. D036 >:::::::::::::::::< |
No guarantees, but have you tried setting FileMode := 0; prior the
call to your read-only bgi files.
...................................................................
Prof. Timo Salmi
Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.87.1
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: t...@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun
What you could do is to override InitGraph and CloseGraph as following:
procedure InitGraph;
Set BGI files to file mode as ordinary file;
call Graph.InitGraph(...);
end;
procedure CloseGraph;
call Graph.CloseGraph;
Set BGI files back to file mode as read only;
end;
:
>In article <casys.681431576@obelix> ca...@obelix.hrz.tu-chemnitz.de writes:
>:
>>corrupting these files. But the problem is, Turbo will produce the error
>>"file not found" when calling InitGraph procedure.
>>This appears because InitGraph uses the DOS call open read/write for opening
>>BGI-driver. I think, a DOS call open read should be enough.
>:
>No guarantees, but have you tried setting FileMode := 0; prior the
>call to your read-only bgi files.
Thanks for Your answer, You are right.
But I think the question for me is:
Why should I do some maniplations, i. e. setting file mode or other,
if there is no need to use an read write open call in Borlands
GRAPH.TPU?
I think, it sould be better, to do something against the cause of this
(i. e. patching GRAPH.TPU), as to do something against the consequences.
The best way to solve this problem seems to be an patch in GRAPH.TPU and
reporting this problem to Borland, so they may solve this problem generally
for future versions.
BTW, calling Borlands Hotline in germany was without results. They dont know
this problem and they had no answer or hint.
Christian
--
+============================================================================+
| Name: Christian Andretzky >:::::::::::::::::< |
| Address: Technische Universitaet Chemnitz >:::::::::::::::::< |
| Fachbereich Maschinenbau III >:::::::::::::::::< |
| Reichenhainer Str. 70 >:::::::::::::::::< |
| Chemnitz >:::::::::::::::::< |
| D-O-9022 >:::::::::::::::::< |
| Phone: +37 71 561 2130 >:::::::::::::::::< |
| FAX: +37 71 561 2413 >:::::::::::::::::< |
| mail: ca...@obelix.hrz.tu-chemnitz.de >:::::::::::::::::< |
+============================================================================+
--
+============================================================================+
| Name: Christian Andretzky >:::::::::::::::::< |
| Address: Technische Universitaet Chemnitz >:::::::::::::::::< |
| Fachbereich Maschinenbau III >:::::::::::::::::< |
Well, what can I say except that because Turbo Pascal has such a
feature when handling readonly files. If you want an access to
readonly files in TP, you just have to reset the FileMode variable
from its default value of 2. It is really not a manipulation in a
true sense of the word, since the original .bgi files are not
touched like they would be if your program first would change the
file attribites of the .bgi files. (That might be another solution.
Strongly _not_ recommended).
I would be surprised if they managed to screw up the .BGI files, but....
You could try setting filemode to 0 before calling initgraph, or
>What you could do is to override InitGraph and CloseGraph as following:
>
>procedure InitGraph;
> Set BGI files to file mode as ordinary file;
> call Graph.InitGraph(...);
>end;
>
>procedure CloseGraph;
> call Graph.CloseGraph;
> Set BGI files back to file mode as read only;
>end;
>
>:
Better yet, just write a new InitGraph:
procedure InitGraph (var grd, grm : integer; path : string);
begin
make_read_write (path + '\*.BGI');
initgraph (grd, grm, path);
make_read_only (path + '\*.BGI');
end;
Then you just need to write the make_read_* procedures.
David R. Conrad, da...@michigan.com
--
= CAT-TALK Conferencing Network, Computer Conferencing and File Archive =
- 1-313-343-0800, 300/1200/2400/9600 baud, 8/N/1. New users use 'new' -
= as a login id. AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET") =
E-MAIL Address: da...@Michigan.COM
Oooh! Good point! The real answer to the question is, just link the
drivers in! Then you don't need to open the files in any mode!
>The best way to solve this problem seems to be an patch in GRAPH.TPU and
>reporting this problem to Borland, so they may solve this problem generally
>for future versions.
>
Tell them, but is setting filemode to 0 or linking in the drivers really
such a difficulty that you would bother to patch the Graph unit?
>BTW, calling Borlands Hotline in germany was without results. They dont know
>this problem and they had no answer or hint.
>
Too bad, I would hope that they would be sharp enough to figure this out.
Perhaps they should post the questions they receive here; we certainly had
no trouble with this one. Anyone at Borland listening? If you guys are
looking to hire Tech Support people, I'm available. :-)
>Christian
Ooooops! Make that call `Graph.InitGraph (grd, grm, path);',
otherwise you get a dynamic halt! :-)
You have to say Graph.initgraph(...). Otherwise, it just calls itself
recursively.
> make_read_only (path + '\*.BGI');
I suppose BGI file is kept open until closegraph is called. It is illegal
to change filemode when the file is still open.
>end;
>