Volume existence with no popup requester?

7 posts / 0 new
Last post
alfkil
alfkil's picture
Offline
Last seen: 3 months 2 weeks ago
Joined: 2011-05-10 22:02
Volume existence with no popup requester?

Is it possible to know, if a volume exists without having to live with the popup requester from DOS asking for the volume to be inserted?

As far as I can see, ExamineObjectTags do not come with a feature to suppress DOS requesters.

trixie
trixie's picture
Offline
Last seen: 7 months 4 days ago
Joined: 2011-02-03 13:58
Re: Volume existence with no popup requester?

@alfkil

  1. APTR procWindow = NULL;
  2.  
  3.  
  4. // Disable DOS requesters.
  5. procWindow = IDOS->SetProcWindow((APTR) -1);
  6.  
  7. // Do your ExamineObjectTags() here.
  8.  
  9. // Re-enable DOS requesters.
  10. IDOS->SetProcWindow(procWindow);

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

salass00
salass00's picture
Offline
Last seen: 6 months 3 weeks ago
Joined: 2011-02-03 11:27
Re: Volume existence with no popup requester?

If you need a file system and not a handler then trying for a SHARED_LOCK with Lock() might be more appropriate than using ExamineObjectTags() if you don't need the ExamineData structure.

Also if the name really must be a volume and not an assign or device or something else you can search the doslist manually using LockDosList()/FindDosEntry()/UnlockDosList(). This is a bit low level but you won't have to disable error requesters then.

alfkil
alfkil's picture
Offline
Last seen: 3 months 2 weeks ago
Joined: 2011-05-10 22:02
Re: Volume existence with no popup requester?

Thanks!

Elwood
Elwood's picture
Offline
Last seen: 4 years 6 months ago
Joined: 2014-03-26 22:49
Re: Volume existence with no popup requester?

And how one could do it *without* C code?
As an example, when using a Python script and os.system()
Maybe we would need some CLI command to enable/disable this option.

--
Elwood

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 7 hours ago
Joined: 2013-05-30 00:53
Re: Volume existence with no popup requester?

You can use something like INFO command (or the function/code in the language used):
#info kdh1:
Discos montados:
Unidad Tamaño Usados Libres Lleno Errs. Estado Nombre Tipo DOS
KDH1: 26G 9.838M 16G 36% 0 Lect./Escr. Utilidades NGF\00

Volúmenes disponibles:
Utilidades: [Montado]
#info kdh11:
kdh11: objeto no encontrado
#

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

xenic
xenic's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2011-05-07 04:52
Re: Volume existence with no popup requester?

@elwood
You can make your own CLI command (script). Here is an example:

; AmigaDOS script
.key myvolume
.bra {
.ket }
IF {myvolume} NOT GT " "
ECHO "Error: No argument entered."
SKIP error
ENDIF
assign {myvolume} exists noreq >NIL:
if WARN
echo "Does not exist."
else
echo "Does exist."
endif
QUIT

LAB error
QUIT 5

X1000 - OS 4.1FE

Log in or register to post comments