AminetAminet
Search:
84703 packages online
About
Recent
Browse
Search
Upload
Setup
Services

util/cli/DeviceLoaded.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:Checks wheter a device is loaded
Author:nyteshade at gmail.com (Brielle Harrison)
Uploader:nyteshade gmail com (Brielle Harrison)
Type:util/cli
Version:1.0
Replaces:util/cli/HasDevice.lha
Architecture:m68k-amigaos (1.x compatible)
Distribution:Aminet
Date:2020-10-25
Download:http://aminet.net/util/cli/DeviceLoaded.lha - View contents
Readme:http://aminet.net/util/cli/DeviceLoaded.readme
Downloads:566

When writing shell scripts for myself, I often found the need
to fork based on whether or not I was working in an emulated
environment like WinUAE or on a real Amiga. One way of doing
this is to check to see if a device is loaded or not.

This is the work of an hour or two to solve that problem. It
accomplishes the task I needed which is to do the following:

1. Allow me to specify any device name
2. Return 5 (WARN) if the device could not be found
3. Optionally quiet output for scripts
4. Have helpful usage information

The source is included. The software license is do whatever you
want with it. 

Thanks to amitrans for pointing out that opening a device was
not the same as detecting the presence of the device in memory.
It took a little while for me to find the solve, but this should
do the trick. 

I have an associated package on Aminet called HasDevice that
will receive an update and rename.

Enjoy!

- Brie


Contents of util/cli/DeviceLoaded.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[unknown]                 4599    6968  66.0% -lh5- 66f2 Oct 25 15:33 DeviceLoaded
[unknown]                 1216    2989  40.7% -lh5- a439 Oct 25 15:32 DeviceLoaded.c
[unknown]                 1952    2409  81.0% -lh5- f3cf Oct 25 15:32 DeviceLoaded.c.info
[unknown]                  395     831  47.5% -lh5- 1109 Oct 25 15:29 DeviceLoaded.info
[unknown]                   67      78  85.9% -lh5- d2d6 Oct 25 15:33 DeviceLoaded.lnk
[unknown]                  988    1620  61.0% -lh5- 269a Oct 25 15:33 DeviceLoaded.o
[unknown]                   30      30 100.0% -lh0- 7cf4 Oct 25 14:13 scoptions
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total         7 files    9247   14925  62.0%            Oct 26 04:19

Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>