[comp.sys.amiga.programmer] Watching a dir

jdickson@jato.jpl.nasa.gov (Jeff Dickson) (05/02/91)

	Since there has much talk of AmigaDOS 2.0, let me hit you all with
this. 

	AmigaDOS 2.0 allows you to get notified when a certain file is mod-
ified. Unfortunately, that only seems to be the case when a file is actually
changed. So I guess if you were watching a directory, you would find out
about everytime a file beneath it were affected. This only works for writing
the file's contents. It doesn't work for reading and executing it. Are my
assumptions correct? UNIX filesystem maintains a date stamp that is updated
everytime a file is accessed. AmigaDOS does not. So if there was some way
to tell what file had been accessed - there would be no way to determine
directly from the filesystem the frequency. The program would have to main-
tain its own datestamp database. 

	I'm trying to see the light at the end of the tunnel on this. Anyone
else have any input on this?

			thanks, Jeff

ccplumb@rose.waterloo.edu (Colin Plumb) (05/02/91)

Yes, your assumptions are correct.  AmigaDOS provides no facilities for
detecting read accesses to a file or directory, except that it won't
let you open a file for write during a read.

Also, with file-change notification, you are notified when a file that
was open for write is closed.  It need not have changed, and you aren't
notified on every write... just when the writes are done.

This is used in preferences (edit the mouse pointer with DPaint, save
it as a brush, bingo!) and is the same as what I've heard about the
"Hot Links" in Apple's System 7.0.
-- 
	-Colin

dillon@overload.Berkeley.CA.US (Matthew Dillon) (05/03/91)

In article <1991May1.170440.13999@jato.jpl.nasa.gov> jdickson@jato.jpl.nasa.gov (Jeff Dickson) writes:
>
>	Since there has much talk of AmigaDOS 2.0, let me hit you all with
>this.
>
>assumptions correct? UNIX filesystem maintains a date stamp that is updated
>everytime a file is accessed. AmigaDOS does not. So if there was some way
>to tell what file had been accessed - there would be no way to determine
>directly from the filesystem the frequency. The program would have to main-
>tain its own datestamp database.
>
>	I'm trying to see the light at the end of the tunnel on this. Anyone
>else have any input on this?
>
>			thanks, Jeff

    UNIX has a last-access-time field, AmigaDOS does not.  The only two
    things in UNIX that really uses the atime field are:

    (1) the shell to determine when to print the 'you have new mail' message.

    (2) system auto-compress programs that compress old unused files (for
	systems that don't have much disk space)

    Frankly, I don't see much of a need for it.  It would generate too much
    disk traffic under AmigaDOS.

				    -Matt
--

    Matthew Dillon	    dillon@Overload.Berkeley.CA.US
    891 Regal Rd.	    uunet.uu.net!overload!dillon
    Berkeley, Ca. 94708
    USA