@Doobrey
Is there an easy way to check that a file/dir exists without having that annoying "Please insert volume:blah blah" requester ?
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <proto/exec.h>
#include <proto/dos.h>
BPTR LockQuiet(const char *name, LONG mode)
{
struct Process *self = (APTR) FindTask(NULL);
APTR oldwinptr;
BPTR lock;
oldwinptr = self->pr_WindowPtr;
self->pr_WindowPtr = (APTR) -1;
lock = Lock(name, mode);
self->pr_WindowPtr = oldwinptr;
return lock;
}
To test existance:
BPTR exists;
exists = LockQuiet("some:path/to/object", ACTION_READ);
if (exists)
{
UnLock(exists);
/* object exists */
}
else
{
/* object doesn't exist */
}
Or am I stuck having to LockDosList() and traverse the list to see if the volume exists ,and only then do a Lock() (not forgetting the UnlockDosList() after !!) ?
No. That would break anyway: You must not Lock() while holding lock of the doslist.