checking if drive is mounted 
Author Message
 checking if drive is mounted

Hello,

I'm mounting a drive via NFS and would need a REXX Script which checks
if the drive is mounted. With qmount i get a list of all availabe
drives also the one vis NFS. I tried to grep in qmount output for
String "NFS" but I'm this didn't work. I never tried REXX but would
need this for my OS/2-PC. Maybe someone allready did something like
that and could post the REXX-Code.

Thanxs,
Max



Tue, 05 Apr 2005 15:01:02 GMT  
 checking if drive is mounted
 > I'm mounting a drive via NFS and would need a REXX Script
 > which checks if the drive is mounted.

/* UNTESTED.CMD */
CALL RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
CALL SysLoadFuncs

/* Get a list off all drives */

drives=SysDriveMap('A:','USED')
SAY 'Available drives:' drives

DO i=1 TO Words(drives)
   drive=Word(drives,i)
   IF SysDriveInfo(drive)='' THEN SAY 'Drive' drive 'is not accessible
now.'
END i

EXIT



Tue, 05 Apr 2005 18:51:10 GMT  
 checking if drive is mounted

Quote:

> I'm mounting a drive via NFS and would need a REXX Script which checks
> if the drive is mounted. With qmount i get a list of all availabe
> drives also the one vis NFS. I tried to grep in qmount output for
> String "NFS" but I'm this didn't work. I never tried REXX but would
> need this for my OS/2-PC. Maybe someone allready did something like
> that and could post the REXX-Code.

This is from a program I use daily:

     /* Build list of local drives. This takes several seconds */
     CALL message "Loading drive list, please wait ..."
     _global._local_drives = ""
     local = 'SysDriveMap'("C:","LOCAL")
     DO i = 1 TO 'WORDS'(local)
         drive = 'WORD'(local,i)
         fs = 'SysFileSystemType'(drive)
         IF fs = "FAT" | fs = "HPFS" | fs = "FAT32" THEN
_global._local_drives = _global._local_drives drive
     END
     _global._local_drives = 'STRIP'(_global._local_drives)

(note that the 8th line is wrapped).

You probably don't want to start with the A: drive as it and B: are
unlikely to be anything other than floppies. By checking the file system
you can determine whether you are looking at a local drive or not. I'm
afraid I don't know what the file system reported for an NFS drive is,
but it isn't difficult to see by adding "say drive fs" after the call to
SysFileSystemType.

Graham.

--
*-* Please remove spam free prefix before replying *-*



Tue, 05 Apr 2005 22:58:53 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. OS/2 REXX, mounted drives, and SysFileTree

2. Need a feature: all drives/mount points

3. Checking AM or PM

4. CHECK DRIVE UNIT COMMAND

5. Disk Drives Check

6. Checking if drive is remote (networked)

7. Check drive A

8. Check Out this Virtual Drive!

9. Check 4 connected drives

10. I am stuk CHECK my Code - access.txt (0/1)

11. Copy file from network drive to local drive?

12. Listing Valid Drives and Drive Types

 

 
Powered by phpBB® Forum Software