Subj : HW 100.2
To   : Amcleod
From : Prime
Date : Sat Dec 08 2001 06:20 am

RE: HW 100.2
BY: Amcleod to Prime on Thu Dec 06 2001 16:04:00

> RE: HW 100.2
> BY: Prime to Amcleod on Tue Sep 19 2000 07:31 am
>
>  >  > Don't try doing arithmetic with file handles!  :)  The arithmetic will
>  >  > fine, but the files themselves are likely to go to hell very shortly
>  >  > thereafter!
>  >
>  > What, exactly, _WOULD_ happen if you _did_ do arithmetic with file handle
>  >
>
> Well, handles are just integers, and they can be just about anything.  for
> instance they may represent integer indexes into a table of file-control-blo
> so if you added your third and fifth handles you would get the handle of som
> file furthur up the table -- possibkly one never opened --  and the results
> accessing that file would be (most likely) a dismal failure with interesting
> side-effects.  Possibly the the handle is the actuall _address_ of the FCB a
> so monkeying with them could give a pointer into some random part of memory
> which would again, give interesting and unpredictable side effects if you tr
> to use it.
>
> You can probably experiment safely with _writing_ the file handle to the
> console.  Open three or four files and print the file handles as integers.
> may get a series of integers like 3, 4, 5, 6 for the four filehandles.  SO y
> add two to the first file handle and it suddenly becomes the third
> filehandle...
> \/s

Just a thought, but shouldn't there be some mechinism to prevent the accidental
adding of file handles?


---
� Synchronet � Viva, le U FAK A P AS Way Type Q! - Remember 9-11