|
a/FileSystem.def.m2cc |
|
b/FileSystem.def.m2cc |
|
... |
|
... |
192 |
(* In der obigen Form kann der SET OpenMode mit den entsprechend *)
|
192 |
(* In der obigen Form kann der SET OpenMode mit den entsprechend *)
|
193 |
(* gesetzten Flaggen wie die unter "C" veroderten Konstanten *)
|
193 |
(* gesetzten Flaggen wie die unter "C" veroderten Konstanten *)
|
194 |
(* O_WRONLY, O_RDWR etc. verwandt werden, wenn vor dem Aufruf der *)
|
194 |
(* O_WRONLY, O_RDWR etc. verwandt werden, wenn vor dem Aufruf der *)
|
195 |
(* C-Routine open(...) OpenMode um 1 Bit nach rechts verschoben *)
|
195 |
(* C-Routine open(...) OpenMode um 1 Bit nach rechts verschoben *)
|
196 |
(* wird. *)
|
196 |
(* wird. *)
|
|
|
197 |
(* In the form given above the SET OpenMode with it approprialy *)
|
|
|
198 |
(* set flags can be used like the "C" constans O_WRONLY, O_RDWR *)
|
|
|
199 |
(* for a call to "C"-touine open(...) if Openmode is shifted by *)
|
|
|
200 |
(* one byte to the right. *)
|
197 |
|
201 |
|
198 |
CONST OpenReadOnly = OpenMode{openRDONLY};
|
202 |
CONST OpenReadOnly = OpenMode{openRDONLY};
|
199 |
OpenWriteOnly = OpenMode{openWRONLY};
|
203 |
OpenWriteOnly = OpenMode{openWRONLY};
|
200 |
OpenReadWrite = OpenMode{openRDWR};
|
204 |
OpenReadWrite = OpenMode{openRDWR};
|
201 |
|
205 |
|
|
... |
|
... |
239 |
(*----------------------------------------------------------------*)
|
243 |
(*----------------------------------------------------------------*)
|
240 |
(* Wird CheckIO auf FALSE gesetzt, werden Fehler nicht mehr *)
|
244 |
(* Wird CheckIO auf FALSE gesetzt, werden Fehler nicht mehr *)
|
241 |
(* auf der Konsole protokoliert. Die Variable Fehler und *)
|
245 |
(* auf der Konsole protokoliert. Die Variable Fehler und *)
|
242 |
(* Fehlerflag werden aber in jedem Fall entsprechende gesetzt, *)
|
246 |
(* Fehlerflag werden aber in jedem Fall entsprechende gesetzt, *)
|
243 |
(* so da3 der Benutzer einen Fehler selbst abfangen kann. *)
|
247 |
(* so da3 der Benutzer einen Fehler selbst abfangen kann. *)
|
|
|
248 |
(* *)
|
|
|
249 |
(* If CheckIO is set to false error messages are no more written *)
|
|
|
250 |
(* to the standard error channel. But in most cases the variables *)
|
|
|
251 |
(* Fehler and Fehlerflag (module Errors) are still set so that *)
|
|
|
252 |
(* a potential error can be captured. *)
|
244 |
(*----------------------------------------------------------------*)
|
253 |
(*----------------------------------------------------------------*)
|
245 |
|
254 |
|
246 |
PROCEDURE Lookup(VAR f : File;
|
255 |
PROCEDURE Lookup(VAR f : File;
|
247 |
DName : ARRAY OF CHAR;
|
256 |
DName : ARRAY OF CHAR;
|
248 |
creat : BOOLEAN;
|
257 |
creat : BOOLEAN;
|
|
... |
|
... |
290 |
(* werden. *)
|
299 |
(* werden. *)
|
291 |
(* Wenn openLARGEFILE in OpenMask wird versucht den *)
|
300 |
(* Wenn openLARGEFILE in OpenMask wird versucht den *)
|
292 |
(* den Support fuer Dateien groesser (2**31-1) zu *)
|
301 |
(* den Support fuer Dateien groesser (2**31-1) zu *)
|
293 |
(* aktivieren, das funktioniert nur wenn dieser *)
|
302 |
(* aktivieren, das funktioniert nur wenn dieser *)
|
294 |
(* vom Dateisystem unterstuetzt wird. *)
|
303 |
(* vom Dateisystem unterstuetzt wird. *)
|
|
|
304 |
(* *)
|
|
|
305 |
(* Open or create a file *)
|
|
|
306 |
(* *)
|
|
|
307 |
(* Example of calls: *)
|
|
|
308 |
(* *)
|
|
|
309 |
(* Lookup(f,"dat",TRUE ,OpenMode{openWRONLY}); *)
|
|
|
310 |
(* Lookup(f,"dat",FALSE,OpenMode{openWRONLY,openAPPEND}); *)
|
|
|
311 |
(* Lookup(f,"dat",FALSE,OpenMode{openWRONLY,openTRUNC}); *)
|
|
|
312 |
(* *)
|
|
|
313 |
(* f : after the call the channel number of the opened *)
|
|
|
314 |
(* file, -1 in case of an error *)
|
|
|
315 |
(* DName : file name of the file to be opened *)
|
|
|
316 |
(* creat : *)
|
|
|
317 |
(* TRUE *)
|
|
|
318 |
(* File will be creat if not present. *)
|
|
|
319 |
(* In case the file is already presen it will be *)
|
|
|
320 |
(* erased and recreated with openCREAT and all *)
|
|
|
321 |
(* requested open directifes (take care) *)
|
|
|
322 |
(* If the actual access right of a file does not *)
|
|
|
323 |
(* permit the operation, f is set to -1 and *)
|
|
|
324 |
(* Errros.Fehlerflag will be set appropriate *)
|
|
|
325 |
(* The new file will be created with access riths *)
|
|
|
326 |
(* defaultAccess. If that is not wanted they have to *)
|
|
|
327 |
(* be changed immediately by a call to ChMod *)
|
|
|
328 |
(* FALSE *)
|
|
|
329 |
(* the file, if present, will be opende with the *)
|
|
|
330 |
(* options requested in OpenMask *)
|
|
|
331 |
(* Optionen ge"offnet, falls vorhanden. *)
|
|
|
332 |
(* If the file is not present or access rights do - *)
|
|
|
333 |
(* not permit an approprite open of the file f will *)
|
|
|
334 |
(* set to -1 and Errors.Fehlerflag will be set *)
|
|
|
335 |
(* accordingly *)
|
|
|
336 |
(* OpenMask : With parameter OpenMask the way the file is opened *)
|
|
|
337 |
(* is controlle. Potential flags for OpenMask can be *)
|
|
|
338 |
(* (openTRUNC,openAPPEND,openRDWR, etc.) *)
|
|
|
339 |
(* If openLARGEFILE in OpenMask the routine tries *)
|
|
|
340 |
(* to activate the support for filess greater then *)
|
|
|
341 |
(* (2**31-1). This will only work if it is supported *)
|
|
|
342 |
(* by the underlaying file system *)
|
295 |
(*----------------------------------------------------------------*)
|
343 |
(*----------------------------------------------------------------*)
|
296 |
|
344 |
|
297 |
PROCEDURE OpenLargeFile(VAR f : File;
|
345 |
PROCEDURE OpenLargeFile(VAR f : File;
|
298 |
name : ARRAY OF CHAR;
|
346 |
name : ARRAY OF CHAR;
|
299 |
creat : BOOLEAN);
|
347 |
creat : BOOLEAN);
|
|
... |
|
... |
308 |
|
356 |
|
309 |
PROCEDURE IsOpen(f : File) : BOOLEAN;
|
357 |
PROCEDURE IsOpen(f : File) : BOOLEAN;
|
310 |
|
358 |
|
311 |
(*----------------------------------------------------------------*)
|
359 |
(*----------------------------------------------------------------*)
|
312 |
(* Ermittelt ob zu Kanalnummer f eine Datei geoeffnet wurde. *)
|
360 |
(* Ermittelt ob zu Kanalnummer f eine Datei geoeffnet wurde. *)
|
|
|
361 |
(* *)
|
|
|
362 |
(* Checks if for channel number f a file had been opened *)
|
313 |
(*----------------------------------------------------------------*)
|
363 |
(*----------------------------------------------------------------*)
|
314 |
|
364 |
|
315 |
PROCEDURE GetFileName( f : File; (* Kanalnummer *)
|
365 |
PROCEDURE GetFileName( f : File; (* Kanalnummer *)
|
316 |
VAR Name : ARRAY OF CHAR); (* Dateiname *)
|
366 |
VAR Name : ARRAY OF CHAR); (* Dateiname *)
|
317 |
|
367 |
|
318 |
(*----------------------------------------------------------------*)
|
368 |
(*----------------------------------------------------------------*)
|
319 |
(* Ermittelt den zur Kanalummer f geh\"orenden Dateinamen. *)
|
369 |
(* Ermittelt den zur Kanalummer f geh\"orenden Dateinamen. *)
|
320 |
(* Die Datei mu3 dabei mit FileSystem.Lookup ge"offnet *)
|
370 |
(* Die Datei mu3 dabei mit FileSystem.Lookup ge"offnet *)
|
321 |
(* worden sein. L"a3t sich der Dateiname nicht ermitteln, *)
|
371 |
(* worden sein. L"a3t sich der Dateiname nicht ermitteln, *)
|
322 |
(* wird 0C in Name[0] zur"uckgegeben. *)
|
372 |
(* wird 0C in Name[0] zur"uckgegeben. *)
|
|
|
373 |
(* *)
|
|
|
374 |
(* Get the filename "Name" of the open file "f". If the routine *)
|
|
|
375 |
(* is unable to get the name 0C is returned. *)
|
323 |
(*----------------------------------------------------------------*)
|
376 |
(*----------------------------------------------------------------*)
|
324 |
|
377 |
|
325 |
PROCEDURE ReWrite(VAR f : File);
|
378 |
PROCEDURE ReWrite(VAR f : File);
|
326 |
|
379 |
|
327 |
(*----------------------------------------------------------------*)
|
380 |
(*----------------------------------------------------------------*)
|
328 |
(* Zur"ucksetzen der Datei f, wobei deren bisheriger Inhalt *)
|
381 |
(* Zur"ucksetzen der Datei f, wobei deren bisheriger Inhalt *)
|
329 |
(* verloren geht. f mu3 einer ge"offneten Datei zugeordnet *)
|
382 |
(* verloren geht. f mu3 einer ge"offneten Datei zugeordnet *)
|
330 |
(* sein. Im Fehlerfall wird f auf -1 gesetzt. *)
|
383 |
(* sein. Im Fehlerfall wird f auf -1 gesetzt. *)
|
331 |
(* Die Datei wird mit der Option oRDWR neu ge"offnet. *)
|
384 |
(* Die Datei wird mit der Option oRDWR neu ge"offnet. *)
|
|
|
385 |
(* *)
|
|
|
386 |
(* Reset the file f. The current content of f is lost. f must *)
|
|
|
387 |
(* be an opened file. In case of an erroe f is set to -1, *)
|
|
|
388 |
(* otherwise the file had been truncted and is now open with *)
|
|
|
389 |
(* mode oRDWR *)
|
332 |
(*----------------------------------------------------------------*)
|
390 |
(*----------------------------------------------------------------*)
|
333 |
|
391 |
|
334 |
PROCEDURE Exists(DName : ARRAY OF CHAR) : BOOLEAN;
|
392 |
PROCEDURE Exists(DName : ARRAY OF CHAR) : BOOLEAN;
|
335 |
|
393 |
|
336 |
(*----------------------------------------------------------------*)
|
394 |
(*----------------------------------------------------------------*)
|
337 |
(* Test, ob eine Datei mit Namen DName im aktuellen *)
|
395 |
(* Test, ob eine Datei mit Namen DName im aktuellen *)
|
338 |
(* Arbeitsverzeichniss vorhanden ist. *)
|
396 |
(* Arbeitsverzeichniss vorhanden ist. *)
|
|
|
397 |
(* *)
|
|
|
398 |
(* Check if a file with name "DName" exits in the actual *)
|
|
|
399 |
(* directory *)
|
339 |
(*----------------------------------------------------------------*)
|
400 |
(*----------------------------------------------------------------*)
|
340 |
|
401 |
|
341 |
PROCEDURE Close(VAR f : File);
|
402 |
PROCEDURE Close(VAR f : File);
|
342 |
|
403 |
|
343 |
(*----------------------------------------------------------------*)
|
404 |
(*----------------------------------------------------------------*)
|
344 |
(* Schlie3t die Datei f. Dabei mu3 f einer ge"offnet Datei *)
|
405 |
(* Schlie3t die Datei f. Dabei mu3 f einer ge"offnet Datei *)
|
345 |
(* zugeordnet sein. Im Fehlerfall wird f auf -1 gesetzt, *)
|
406 |
(* zugeordnet sein. Im Fehlerfall wird f auf -1 gesetzt, *)
|
346 |
(* ansonsten ist f = 0. *)
|
407 |
(* ansonsten ist f = 0. *)
|
|
|
408 |
(* *)
|
|
|
409 |
(* Close opened file f. In case of an error f is set to -1, *)
|
|
|
410 |
(* otherwise f is 0 after the call. *)
|
347 |
(*----------------------------------------------------------------*)
|
411 |
(*----------------------------------------------------------------*)
|
348 |
|
412 |
|
349 |
PROCEDURE CloseAll();
|
413 |
PROCEDURE CloseAll();
|
350 |
|
414 |
|
351 |
(*----------------------------------------------------------------*)
|
415 |
(*----------------------------------------------------------------*)
|
352 |
(* Schlie\3t alle offenen Dateien, privat f"ur das Projekt. *)
|
416 |
(* Schlie\3t alle offenen Dateien, privat f"ur das Projekt. *)
|
|
|
417 |
(* *)
|
|
|
418 |
(* Closes all open files, privat for the Projekt. *)
|
353 |
(*----------------------------------------------------------------*)
|
419 |
(*----------------------------------------------------------------*)
|
354 |
|
420 |
|
355 |
PROCEDURE Delete( Name : ARRAY OF CHAR;
|
421 |
PROCEDURE Delete( Name : ARRAY OF CHAR;
|
356 |
VAR f : File);
|
422 |
VAR f : File);
|
357 |
|
423 |
|
358 |
(*----------------------------------------------------------------*)
|
424 |
(*----------------------------------------------------------------*)
|
359 |
(* L"oscht die Datei Name aus dem Dateiverzeichnis. *)
|
425 |
(* L"oscht die Datei Name aus dem Dateiverzeichnis. *)
|
360 |
(* Die Datei f mu3 dabei geo2ffnet und auf Name verweisen. *)
|
426 |
(* Die Datei f mu3 dabei geo2ffnet und auf Name verweisen. *)
|
361 |
(* Im Fehlerfalle wird f auf -1 gesetzt. *)
|
427 |
(* Im Fehlerfalle wird f auf -1 gesetzt. *)
|
|
|
428 |
(* *)
|
|
|
429 |
(* Deletes the file with name "Name". The file f must be opened *)
|
|
|
430 |
(* and pointing to the file with name "Name". In case of an error *)
|
|
|
431 |
(* f is set to -1 *)
|
362 |
(*----------------------------------------------------------------*)
|
432 |
(*----------------------------------------------------------------*)
|
363 |
|
433 |
|
364 |
PROCEDURE Length( f : File;
|
434 |
PROCEDURE Length( f : File;
|
365 |
VAR Len : LONGCARD);
|
435 |
VAR Len : LONGCARD);
|
366 |
|
436 |
|
367 |
(*----------------------------------------------------------------*)
|
437 |
(*----------------------------------------------------------------*)
|
368 |
(* Ermittelt die L"ange der mit f verbundenen, ge"offneten *)
|
438 |
(* Ermittelt die L"ange der mit f verbundenen, ge"offneten *)
|
369 |
(* Datei in Bytes. Im Fehlerfalle werden nur Fehler und *)
|
439 |
(* Datei in Bytes. Im Fehlerfalle werden nur Fehler und *)
|
370 |
(* Fehlerflag gesetzt und Len auf MAX(LONGCARD). *)
|
440 |
(* Fehlerflag gesetzt und Len auf MAX(LONGCARD). *)
|
|
|
441 |
(* *)
|
|
|
442 |
(* Get the length file f where f needs to be assigned to an open *)
|
|
|
443 |
(* file. In case of an error Fehler and Fehlerfalg (module *)
|
|
|
444 |
(* Errors) are set and Len is set to MAX(LONGCARD) *)
|
371 |
(*----------------------------------------------------------------*)
|
445 |
(*----------------------------------------------------------------*)
|
372 |
|
446 |
|
373 |
PROCEDURE GetPos( f : File;
|
447 |
PROCEDURE GetPos( f : File;
|
374 |
VAR Pos : FilePos);
|
448 |
VAR Pos : FilePos);
|
375 |
|
449 |
|
376 |
(*----------------------------------------------------------------*)
|
450 |
(*----------------------------------------------------------------*)
|
377 |
(* Ermittelt die aktuelle Dateiposition in der ge"offneten *)
|
451 |
(* Ermittelt die aktuelle Dateiposition in der ge"offneten *)
|
378 |
(* Datei f. Im Fehlerfall wird Pos auf MAX(LONGCARD) gesetzt. *)
|
452 |
(* Datei f. Im Fehlerfall wird Pos auf MAX(LONGCARD) gesetzt. *)
|
|
|
453 |
(* *)
|
|
|
454 |
(* Get the current file position of file f and return the value *)
|
|
|
455 |
(* in "Pos". If case of an error Pos is set to MAX(LONGCARD). *)
|
379 |
(*----------------------------------------------------------------*)
|
456 |
(*----------------------------------------------------------------*)
|
380 |
|
457 |
|
381 |
PROCEDURE SetPos(VAR f : File;
|
458 |
PROCEDURE SetPos(VAR f : File;
|
382 |
Pos : FilePos);
|
459 |
Pos : FilePos);
|
383 |
|
460 |
|
384 |
(*----------------------------------------------------------------*)
|
461 |
(*----------------------------------------------------------------*)
|
385 |
(* Setzt die Dateiposition der ge"offneten Datei f. *)
|
462 |
(* Setzt die Dateiposition der ge"offneten Datei f. *)
|
386 |
(* Im Fehlerfall werden nur Fehler und Fehlerflag gesetzt. *)
|
463 |
(* Im Fehlerfall werden nur Fehler und Fehlerflag gesetzt. *)
|
|
|
464 |
(* *)
|
|
|
465 |
(* Sets the file position of file f to "Pos". If case of an error *)
|
|
|
466 |
(* Fehler and Fehlerfalg (module Errors) are set. *)
|
387 |
(*----------------------------------------------------------------*)
|
467 |
(*----------------------------------------------------------------*)
|
388 |
|
468 |
|
389 |
PROCEDURE Rewind(VAR f : File);
|
469 |
PROCEDURE Rewind(VAR f : File);
|
390 |
|
470 |
|
391 |
(*---------------------------------------------------------------*)
|
471 |
(*----------------------------------------------------------------*)
|
392 |
(* Zurueckstellen des Dateizeiger auf Position 0. *)
|
472 |
(* Zurueckstellen des Dateizeiger auf Position 0. *)
|
|
|
473 |
(* *)
|
393 |
(* Set the position of (large) file f to position zero. *)
|
474 |
(* Set the position of (large) file f to position zero. *)
|
394 |
(*---------------------------------------------------------------*)
|
475 |
(*----------------------------------------------------------------*)
|
395 |
|
476 |
|
396 |
PROCEDURE ReadNBytes( f : File;
|
477 |
PROCEDURE ReadNBytes( f : File;
|
397 |
VAR Ziel : ARRAY OF BYTE;
|
478 |
VAR Ziel : ARRAY OF BYTE;
|
398 |
n : CARDINAL; (* Anzahl der Bytes *)
|
479 |
n : CARDINAL; (* Anzahl der Bytes *)
|
399 |
VAR m : CARDINAL); (* Anzahl gelesener Bytes *)
|
480 |
VAR m : CARDINAL); (* Anzahl gelesener Bytes *)
|
|
... |
|
... |
401 |
(*----------------------------------------------------------------*)
|
482 |
(*----------------------------------------------------------------*)
|
402 |
(* Liest n Bytes von der Datei f in Ziel. Ist ein Lesen nicht *)
|
483 |
(* Liest n Bytes von der Datei f in Ziel. Ist ein Lesen nicht *)
|
403 |
(* m"oglich, so wird m auf 0 gesetzt. Ist m # 0, m < n, so *)
|
484 |
(* m"oglich, so wird m auf 0 gesetzt. Ist m # 0, m < n, so *)
|
404 |
(* ist das Dateiende erreicht. Ansonsten ist nach verlassen *)
|
485 |
(* ist das Dateiende erreicht. Ansonsten ist nach verlassen *)
|
405 |
(* der Routine m = n. *)
|
486 |
(* der Routine m = n. *)
|
|
|
487 |
(* *)
|
|
|
488 |
(* Reads n bytes form file f into buffer "Ziel". If reading is *)
|
|
|
489 |
(* not possible m will be set to 0. m generally indicates the *)
|
|
|
490 |
(* amount of bytes read, if m # 0 and m < n after a call the end *)
|
|
|
491 |
(* of file f is most probably reached. In normal cases m = n *)
|
|
|
492 |
(* should hold after the call to this procedure *)
|
406 |
(*----------------------------------------------------------------*)
|
493 |
(*----------------------------------------------------------------*)
|
407 |
|
494 |
|
408 |
PROCEDURE WriteNBytes( f : File;
|
495 |
PROCEDURE WriteNBytes( f : File;
|
409 |
VAR Quelle : ARRAY OF BYTE;
|
496 |
VAR Quelle : ARRAY OF BYTE;
|
410 |
n : CARDINAL; (* Anzahl der Bytes *)
|
497 |
n : CARDINAL; (* Anzahl der Bytes *)
|
|
... |
|
... |
413 |
(*----------------------------------------------------------------*)
|
500 |
(*----------------------------------------------------------------*)
|
414 |
(* Schreibt n Bytes von Ziel auf die Datei f. Ist ein Schreiben *)
|
501 |
(* Schreibt n Bytes von Ziel auf die Datei f. Ist ein Schreiben *)
|
415 |
(* nicht m"oglich, so wird m auf 0 gesetzt. Ist m # 0, m < n, so *)
|
502 |
(* nicht m"oglich, so wird m auf 0 gesetzt. Ist m # 0, m < n, so *)
|
416 |
(* wahrscheinlich das Medium, auf das geschrieben werden soll, *)
|
503 |
(* wahrscheinlich das Medium, auf das geschrieben werden soll, *)
|
417 |
(* voll. Ansonsten ist nach verlassen der Routine m = n. *)
|
504 |
(* voll. Ansonsten ist nach verlassen der Routine m = n. *)
|
|
|
505 |
(* *)
|
|
|
506 |
(* Write n bytes from "Quelle" out to file f. If writing is not *)
|
|
|
507 |
(* possible m will be set to 0. m generally indicates the amount *)
|
|
|
508 |
(* of bytes written, if m # 0 and m < n after a call the device *)
|
|
|
509 |
(* the file f is on is most probably full. In normal cases m = n *)
|
|
|
510 |
(* should hold after the call to this procedure *)
|
418 |
(*----------------------------------------------------------------*)
|
511 |
(*----------------------------------------------------------------*)
|
419 |
|
512 |
|
420 |
PROCEDURE RdBinObj( Ein : File;
|
513 |
PROCEDURE RdBinObj( Ein : File;
|
421 |
VAR A : ARRAY OF BYTE;
|
514 |
VAR A : ARRAY OF BYTE;
|
422 |
N : CARDINAL;
|
515 |
N : CARDINAL;
|
|
... |
|
... |
427 |
(* Die Routine arbeitet blockorientiert. *)
|
520 |
(* Die Routine arbeitet blockorientiert. *)
|
428 |
(* *)
|
521 |
(* *)
|
429 |
(* ifehl = 0 : Alles in Ordnung *)
|
522 |
(* ifehl = 0 : Alles in Ordnung *)
|
430 |
(* ifehl = 1 : Ein Lesefehler ist aufgetreten *)
|
523 |
(* ifehl = 1 : Ein Lesefehler ist aufgetreten *)
|
431 |
(* ifehl = 2 : A ist zu klein um n Elemente aufnehemn zu k"onnen *)
|
524 |
(* ifehl = 2 : A ist zu klein um n Elemente aufnehemn zu k"onnen *)
|
|
|
525 |
(* *)
|
|
|
526 |
(* Binary read of object A with size N bytes frim file "Aus". *)
|
|
|
527 |
(* The routine is working block-oriented *)
|
|
|
528 |
(* *)
|
|
|
529 |
(* ifehl = 0 : all fine *)
|
|
|
530 |
(* ifehl = 1 : a read error occured *)
|
|
|
531 |
(* ifehl = 2 : A is smaller than N bytes *)
|
432 |
(*----------------------------------------------------------------*)
|
532 |
(*----------------------------------------------------------------*)
|
433 |
|
533 |
|
434 |
PROCEDURE WrBinObj( Aus : File;
|
534 |
PROCEDURE WrBinObj( Aus : File;
|
435 |
VAR A : ARRAY OF BYTE;
|
535 |
VAR A : ARRAY OF BYTE;
|
436 |
N : CARDINAL;
|
536 |
N : CARDINAL;
|
|
... |
|
... |
439 |
(*----------------------------------------------------------------*)
|
539 |
(*----------------------------------------------------------------*)
|
440 |
(* Binaeres scheiben des Objekts A der Groesse N Byte auf Aus. *)
|
540 |
(* Binaeres scheiben des Objekts A der Groesse N Byte auf Aus. *)
|
441 |
(* Die Routine arbeitet blockorientiert. *)
|
541 |
(* Die Routine arbeitet blockorientiert. *)
|
442 |
(* *)
|
542 |
(* *)
|
443 |
(* ifehl = 0 : Alles in Ordnung *)
|
543 |
(* ifehl = 0 : Alles in Ordnung *)
|
444 |
(* ifehl = 1 : Ein Lesefehler ist aufgetreten *)
|
544 |
(* ifehl = 1 : Ein Schreibfehler ist aufgetreten *)
|
445 |
(* ifehl = 2 : A ist zu klein um n Elemente aufnehemn zu k"onnen *)
|
545 |
(* ifehl = 2 : A ist zu klein um n Elemente aufnehemn zu k"onnen *)
|
|
|
546 |
(* *)
|
|
|
547 |
(* Binary write of object A with size N bytes to file "Aus". *)
|
|
|
548 |
(* The routine is working block-oriented *)
|
|
|
549 |
(* *)
|
|
|
550 |
(* ifehl = 0 : all fine *)
|
|
|
551 |
(* ifehl = 1 : a write error occured *)
|
|
|
552 |
(* ifehl = 2 : A is smaller than N bytes *)
|
446 |
(*----------------------------------------------------------------*)
|
553 |
(*----------------------------------------------------------------*)
|
447 |
|
554 |
|
448 |
(*============== Unix - spezifische Routinen. ==============*)
|
555 |
(*============== Unix - spezifische Routinen. ==============*)
|
449 |
(*============== F"ur DOS ohne Bedeutung. ==============*)
|
556 |
(*============== F"ur DOS ohne Bedeutung. ==============*)
|
450 |
|
557 |
|
|
... |
|
... |
454 |
(*----------------------------------------------------------------*)
|
561 |
(*----------------------------------------------------------------*)
|
455 |
(* Setzt die Zugriffsrechte f"ur die Datei f. Dabei mu3 f einer *)
|
562 |
(* Setzt die Zugriffsrechte f"ur die Datei f. Dabei mu3 f einer *)
|
456 |
(* ge"offneten Datei zugeordnet sein. Ist dies nicht der Fall, *)
|
563 |
(* ge"offneten Datei zugeordnet sein. Ist dies nicht der Fall, *)
|
457 |
(* wird f auf -1 gesetzt. Bei sonstigen Fehlern wird nur Fehler *)
|
564 |
(* wird f auf -1 gesetzt. Bei sonstigen Fehlern wird nur Fehler *)
|
458 |
(* und Fehlerflag gesetzt. *)
|
565 |
(* und Fehlerflag gesetzt. *)
|
|
|
566 |
(* *)
|
|
|
567 |
(* Sets the acces rights for file f. For that f must be assigend *)
|
|
|
568 |
(* to a open file. If that's not the case f is set to -1. If case *)
|
|
|
569 |
(* of other failures Fehler and Fehlerflag (module Errors) are *)
|
|
|
570 |
(* set. *)
|
459 |
(*----------------------------------------------------------------*)
|
571 |
(*----------------------------------------------------------------*)
|
460 |
|
572 |
|
461 |
PROCEDURE Lock(VAR f : File);
|
573 |
PROCEDURE Lock(VAR f : File);
|
462 |
|
574 |
|
463 |
(*----------------------------------------------------------------*)
|
575 |
(*----------------------------------------------------------------*)
|
464 |
(* Verh"angt eine Schreibsperre f"ur den offenen *)
|
576 |
(* Verh"angt eine Schreibsperre f"ur den offenen *)
|
465 |
(* Ausgabekanal f gegen"uber anderen Prozessen. *)
|
577 |
(* Ausgabekanal f gegen"uber anderen Prozessen. *)
|
|
|
578 |
(* *)
|
|
|
579 |
(* Locks the file f from access by other processes *)
|
466 |
(*----------------------------------------------------------------*)
|
580 |
(*----------------------------------------------------------------*)
|
467 |
|
581 |
|
468 |
PROCEDURE UnLock(VAR f : File);
|
582 |
PROCEDURE UnLock(VAR f : File);
|
469 |
|
583 |
|
470 |
(*----------------------------------------------------------------*)
|
584 |
(*----------------------------------------------------------------*)
|
471 |
(* Hebt die Schreibsperre des offenen Ausgabekanals f *)
|
585 |
(* Hebt die Schreibsperre des offenen Ausgabekanals f *)
|
472 |
(* gegen"uber anderen Prozessen auf. *)
|
586 |
(* gegen"uber anderen Prozessen auf. *)
|
|
|
587 |
(* *)
|
|
|
588 |
(* Removes a lock on file f *)
|
473 |
(*----------------------------------------------------------------*)
|
589 |
(*----------------------------------------------------------------*)
|
474 |
|
590 |
|
475 |
PROCEDURE Sync();
|
591 |
PROCEDURE Sync();
|
476 |
|
592 |
|
477 |
(*----------------------------------------------------------------*)
|
593 |
(*----------------------------------------------------------------*)
|
478 |
(* Syncronisation des Dateisystms. *)
|
594 |
(* Syncronisation des Dateisystms. *)
|
|
|
595 |
(* *)
|
|
|
596 |
(* sync of the file system *)
|
479 |
(*----------------------------------------------------------------*)
|
597 |
(*----------------------------------------------------------------*)
|
480 |
|
598 |
|
481 |
END FileSystem.
|
599 |
END FileSystem.
|