2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include "dos_intern.h"
11 /*****************************************************************************
15 #include <aros/debug.h>
16 #include <dos/notify.h>
17 #include <proto/dos.h>
19 AROS_LH1(BOOL
, StartNotify
,
22 AROS_LHA(struct NotifyRequest
*, notify
, D1
),
25 struct DosLibrary
*, DOSBase
, 148, Dos
)
29 Send a notification request to a filesystem. You will then be notified
30 whenever the file (or directory) changes.
34 notify -- a notification request for the file or directory to monitor
38 Success/failure indicator.
42 The file or directory connected to a notification request does not have
43 to exist at the time of calling StartNotify().
44 The NotifyRequest used with this function should not be altered while
53 EndNotify(), <dos/notify.h>
57 *****************************************************************************/
60 AROS_LIBBASE_EXT_DECL(struct DosLibrary
*,DOSBase
)
62 struct IOFileSys iofs
;
63 struct FileHandle
*dir
;
65 /* Prepare I/O request. */
66 InitIOFS(&iofs
, FSA_ADD_NOTIFY
, DOSBase
);
68 iofs
.io_Union
.io_NOTIFY
.io_NotificationRequest
= notify
;
70 notify
->nr_MsgCount
= 0;
72 if (strchr(notify
->nr_Name
, ':') != NULL
)
74 DoName(&iofs
, notify
->nr_Name
, DOSBase
);
78 dir
= BADDR(CurrentDir(NULL
));
79 CurrentDir(MKBADDR(dir
)); /* Set back the current dir */
86 iofs
.IOFS
.io_Device
= dir
->fh_Device
;
87 iofs
.IOFS
.io_Unit
= dir
->fh_Unit
;
89 /* Save device for EndNotify() purposes */
90 notify
->nr_Device
= dir
->fh_Device
;
92 if (iofs
.IOFS
.io_Device
== NULL
)
100 SetIoErr(iofs
.io_DosError
);
102 if (iofs
.io_DosError
!= 0)