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

util/cli/HasDevice.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:Checks for the existence of a device
Author:Brielle Harrison
Uploader:nyteshade gmail com (Brielle Harrison)
Type:util/cli
Version:1.0
Architecture:m68k-amigaos
Distribution:Aminet
Date:2020-10-18
Download:http://aminet.net/util/cli/HasDevice.lha - View contents
Readme:http://aminet.net/util/cli/HasDevice.readme
Downloads:529

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 was to check for the existence of uaehf.device vs.
scsi.device or something along those lines.

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 opened
3. Specify a unit number or default to 0
4. Optionally quiet output for scripts
5. Have helpful usage information

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


**Compiled with SAS/C 6.58 using "sc link HasDevice.c"**
**A version shrunken with Shrinkler is included; HasDevice.s**
**Shrinkler version has no version information**

Enjoy!

- Brie


Contents of util/cli/HasDevice.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[unknown]                 6247    9796  63.8% -lh5- df40 Oct 18 15:31 HasDevice
[unknown]                 1174    3416  34.4% -lh5- b7d7 Oct 18 15:30 HasDevice.c
[unknown]                   66      72  91.7% -lh5- b953 Oct 18 15:31 HasDevice.lnk
[unknown]                 1228    2024  60.7% -lh5- 08e8 Oct 18 15:31 HasDevice.o
[unknown]                 6032    6032 100.0% -lh0- adf5 Oct 18 15:32 HasDevice.s
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total         5 files   14747   21340  69.1%            Oct 19 02:18

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