Detect running from a CD 
Author Message
 Detect running from a CD

Is there any way for my code to detect that it is running from a CD?  I
could check to see if all the files are +R, but that is certainly no
guarantee.

Doug Rickman



Mon, 05 Feb 2001 03:00:00 GMT  
 Detect running from a CD


Quote:
>Is there any way for my code to detect that it is running from a CD?  I
>could check to see if all the files are +R, but that is certainly no
>guarantee.
>Doug Rickman

One way is to make a call to REXXUTIL function sysdriveinfo

if the cdrom is G: then

say sysdriveinfo('G')  would say

G:  0            539809792    OS2WARP4

the give away is the free space is always 0 for CDROM

Mark
-----------------------
Mark Schlegel
-----------------------



Mon, 05 Feb 2001 03:00:00 GMT  
 Detect running from a CD

 DR> Is there any way for my code to detect that it is running from a CD?

 - You cannot create a file on a CD (or on a full "normal" disk, FWIW)
 - I cannot check now wether if "classic" REXX (OS/2) offers this parameter
   but some REXXUTIL.DLL-versions (e.g. the one that comes with Object REXX
   for Win**) can tell you if a drive is a CD-ROM or perhaps which filesys-
   tem is used. E.g. SysDriveMap().



Tue, 06 Feb 2001 03:00:00 GMT  
 Detect running from a CD

Quote:

>  - You cannot create a file on a CD (or on a full "normal" disk, FWIW)

Also, trying to write to a LAN drive where you have r/o access will
cause it to fail.

Quote:
>  - I cannot check now wether if "classic" REXX (OS/2) offers this parameter
>    but some REXXUTIL.DLL-versions (e.g. the one that comes with Object REXX
>    for Win**) can tell you if a drive is a CD-ROM or perhaps which filesys-
>    tem is used. E.g. SysDriveMap().

You could also write a DLL which checks to see if the drive is removable
media AND has 0 free space.


Tue, 06 Feb 2001 03:00:00 GMT  
 Detect running from a CD
  ========== in reply to ==========


  Date- Thu, 20 Aug 1998 10:45:04 -0400
  Subj- Detect running from a CD

/----begin quote-----
| Is there any way for my code to detect that it is running from a CD?
| I could check to see if all the files are +R, but that is certainly no
| guarantee.
\----end quote-----

If you use the REXXLIB.DLL, there is the following function in there.
Perhaps this is what you need?

 DOSFILESYS([drive])

 Summary:    DOSFILESYS returns the type of file system on a specified
             drive.

 Arguments:  drive:  A valid disk drive letter. The default is the
current
                     drive.

 Returns:    The name of the file system as reported by the installable
             file system driver.

 Notes:      Possible names include "FAT", "HPFS", "CDFS", and "HPOFS".
             This call can be used, for example, to identify a CD-ROM
             drive ("CDFS") if a disk is loaded in the drive.

   - r4 -

--
I Have Learned...
that sometimes the people you expect to kick you when you're down
may be the ones to help you get back up.
--------------------------------------------

The REXX Shop        http://www.rexxshop.com
Join our friendly maillist.  Send e-mail to

as the only word in the BODY of the mail.
--------------------------------------------
Try some free ICE Cream, our MR/2 ICE add-on
to automate and log your e-mail retrieval.



Tue, 06 Feb 2001 03:00:00 GMT  
 Detect running from a CD

Quote:


> >  - You cannot create a file on a CD (or on a full "normal" disk, FWIW)

> Also, trying to write to a LAN drive where you have r/o access will
> cause it to fail.

> >  - I cannot check now wether if "classic" REXX (OS/2) offers this parameter
> >    but some REXXUTIL.DLL-versions (e.g. the one that comes with Object REXX
> >    for Win**) can tell you if a drive is a CD-ROM or perhaps which filesys-
> >    tem is used. E.g. SysDriveMap().

> You could also write a DLL which checks to see if the drive is removable
> media AND has 0 free space.

But the question remains, what and where is the information that the
drive is removable media?

Doug Rickman



Sat, 10 Feb 2001 03:00:00 GMT  
 Detect running from a CD

Quote:

> > Is there any way for my code to detect that it is running from a CD?  I
> > could check to see if all the files are +R, but that is certainly no
> > guarantee.

> A CD will appear to have no free space.  Are you attempting to defeat
> programs which make it look like you are running from a CD, or do you just
> want to know if you can write things like configuration info?

I'm writing code to install software.  It can be run from either a CD or
a hard drive.  When it runs from CD I have to find somewhere else to
create temporary files.  Otherwise I write them in the current
directory.

Right now I have to maintain two seperate programs, one for CD, one for
FTP downloads.  with the information Bob Rice provided I can merge the
two programs into one.

Doug Rickman



Sun, 11 Feb 2001 03:00:00 GMT  
 Detect running from a CD

Quote:

>   ========== in reply to ==========


>   Date- Thu, 20 Aug 1998 10:45:04 -0400
>   Subj- Detect running from a CD

> /----begin quote-----
> | Is there any way for my code to detect that it is running from a CD?
> | I could check to see if all the files are +R, but that is certainly no
> | guarantee.
> \----end quote-----

> If you use the REXXLIB.DLL, there is the following function in there.
> Perhaps this is what you need?

>  DOSFILESYS([drive])

Hurray for REXXLIB.  It comes to my rescue once again.  I load it by
default, but had missed this function.

Thanks.

Doug



Sun, 11 Feb 2001 03:00:00 GMT  
 Detect running from a CD

Quote:

>I'm writing code to install software.  It can be run from either a CD or
>a hard drive.  When it runs from CD I have to find somewhere else to
>create temporary files.  Otherwise I write them in the current
>directory.

Do the files necessarily have to be in the current directory if you are not
installing from CD?  (Also, if the TMPDIR environment is set I might think
that's a better place for temporary files than the current directory.)
--

------ http://www.comlab.ox.ac.uk/oucl/users/ian.collier/imc.html

New to this group?  Answers to frequently-asked questions can be had from
http://rexx.hursley.ibm.com/rexx/ .



Sun, 11 Feb 2001 03:00:00 GMT  
 Detect running from a CD

Quote:


> >I'm writing code to install software.  It can be run from either a CD or
> >a hard drive.  When it runs from CD I have to find somewhere else to
> >create temporary files.  Otherwise I write them in the current
> >directory.

> Do the files necessarily have to be in the current directory if you are not
> installing from CD?  (Also, if the TMPDIR environment is set I might think
> that's a better place for temporary files than the current directory.)
> --

I whole heartedly agree, if only I could count on TMPDIR, TMP or TEMP
being set.  

My routine is aimed at users who know essentially nothing about OS/2,
therefore I have tried to make something that was fairly simple minded.
If anyone wants a copy they are perfectly free to have it.  It uses
VisPro and REXXLIB.  It checks for an environment variable and a PATH,
allows them to be modified if desired as well as backs up the current
CONFIG.SYS

I want to thank everyone that has contributed to this thread.  You have
all been most helpful.

Doug Rickman



Mon, 12 Feb 2001 03:00:00 GMT  
 Detect running from a CD
My recommendation is to forget about testing for CD-ROM and test for
available space. If there is less available space ten you will require for
work files, put up a path entry box. Note that this will automatically
handle the case of the CD-ROM properly.

If the user is installing from a hard drive and the logical drive or
partition is full, you don't want to install to fail; the same logic that
you use for a CD-ROM install should be used in this case as well.

Shmuel (Seymour J.) Metz

Quote:
> -----Original Message-----

> Sent: Thursday, August 27, 1998 8:23 AM

> Subject:      Re: Detect running from a CD




> > >I'm writing code to install software.  It can be run from either a CD
> or
> > >a hard drive.  When it runs from CD I have to find somewhere else to
> > >create temporary files.  Otherwise I write them in the current
> > >directory.

> > Do the files necessarily have to be in the current directory if you are
> not
> > installing from CD?  (Also, if the TMPDIR environment is set I might
> think
> > that's a better place for temporary files than the current directory.)
> > --

> I whole heartedly agree, if only I could count on TMPDIR, TMP or TEMP
> being set.

> My routine is aimed at users who know essentially nothing about OS/2,
> therefore I have tried to make something that was fairly simple minded.
> If anyone wants a copy they are perfectly free to have it.  It uses
> VisPro and REXXLIB.  It checks for an environment variable and a PATH,
> allows them to be modified if desired as well as backs up the current
> CONFIG.SYS

> I want to thank everyone that has contributed to this thread.  You have
> all been most helpful.

> Doug Rickman



Mon, 12 Feb 2001 03:00:00 GMT  
 Detect running from a CD

Quote:


> [skissors were here]
> > I'm writing code to install software.  It can be run from either a CD or
> > a hard drive.  When it runs from CD I have to find somewhere else to
> > create temporary files.  Otherwise I write them in the current
> > directory.
> --
> Hi!
> If you prepare CD yourself, you are able to provide some specific
> information (volume label etc.) to detect install from CD.
> And temporary files (as Ian mentioned) may be written to temp directory.
> To detect it you may use Value('TMP', , 'OS2ENVIRONMENT')
> --------------  8-)  --------------
> Regards, Vladimir (http://i.am/kzm)

Thank you.  An excellent suggestion.

Doug



Fri, 16 Feb 2001 03:00:00 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Detecting CD Rom Drive

2. detect CD-Rom type

3. ? detect disk in CD drive

4. - detect CD-ROM drive

5. Programming CD-ROM/CD-R/CD-RW

6. Programming CD-ROM/CD-R/CD-RW

7. Detect if another program is running

8. Detecting remote run of application - PC Anywhere

9. Selecting a CD Drive at Run Time

10. Detecting multiple instances of running app

11. API call to detect running programs

12. Read error / Corruption detected while running on Netware drive

 

 
Powered by phpBB® Forum Software