[comp.sys.amiga.tech] Protect Failed

andy@cbmvax.UUCP (Andy Finkel) (11/01/88)

In article <9968@swan.ulowell.edu> page@swan.ulowell.edu (Bob Page) writes:
>[followups to comp.sys.amiga.tech]
>
>andy@cbmvax.UUCP (Andy Finkel) wrote:
>>Any file currently in use can't have its protection bits changes
>>(under 1.1, 1.2, 1.3)  Locks (ie Assigns) count as 'in use'.
>
>So why can't you look at "in use" file system resources?
>
>This has always seemed arbitrary to me, especially something as
>harmless as poking attribute bits in the fileheader when another
>process is reading the data in the file.

I specified it as carefully as I did precisely because it
may change in the future.  We're not locked into having it work
precisely the way it does now; on the other hand, we like to
have a pretty good idea of the full implications of a change before we
make it.

>
>But the real reason is I want to do the Unix equivalent of
>
>datagenerator >>logfile
>tail -f file
>
>Sure, I can say
>	datagenerator | tee >>logfile
>but that begs the question.  I'm sure the answer can't be "because we
>want to avoid race conditions" when you have something as notorious as
>ExNext() out there.

What a peculiar statement; possibly the running the source groups
(BTW, you seem to be doing a great job so far) is effecting your
mind. :-)  Are you saying that because we have one area of vunerability,
additional ones are OK ?

Anyway, back to the request:

You can do this now; there are dangers, certainly, but the worst
that should happen is the file will get corrupted if you have
2 writers.  It will be made safer in the future.

(Using 1.3 AmigaShell you can do this on an existing file, ie

echo >logfile
datagenerator >>logfile
tail -f logfile

assuming, of course, that your tail doesn't want exclusive access.
-- 
andy finkel		{uunet|rutgers|amiga}!cbmvax!andy
Commodore-Amiga, Inc.

"I first began to lose faith in software engineering when I found out
 that no two printers were compatible."

Any expressed opinions are mine; but feel free to share.
I disclaim all responsibilities, all shapes, all sizes, all colors.

ditto@cbmvax.UUCP (Michael "Ford" Ditto) (11/01/88)

In article <5157@cbmvax.UUCP> andy@cbmvax.UUCP (Andy Finkel) writes:
>In article <9968@swan.ulowell.edu> page@swan.ulowell.edu (Bob Page) writes:
>>But the real reason is I want to do the Unix equivalent of
>>
>>datagenerator >>logfile
>>tail -f file
 [ .. .]
>>				I'm sure the answer can't be "because we
>>want to avoid race conditions" when you have something as notorious as
>>ExNext() out there.

>What a peculiar statement; possibly the running the source groups
>(BTW, you seem to be doing a great job so far) is effecting your
>mind. :-)  Are you saying that because we have one area of vunerability,
>additional ones are OK ?

I think he meant that ExNext is such an intensely hairy thing to
implement right, that proper support for file sharing is easy by
comparison.  I'll continue to be frustrated by AmigaDos's "file
sharing" until it is the default mode for fopen(), shell redirection,
etc., and all these "can't do FOO, object in use" errors no longer
happen.
-- 
					-=] Ford [=-

"The number of Unix installations	(In Real Life:  Mike Ditto)
has grown to 10, with more expected."	ford@kenobi.cts.com
- The Unix Programmer's Manual,		...!sdcsvax!crash!elgar!ford
  2nd Edition, June, 1972.		ditto@cbmvax.commodore.com