New topic: 

VolumeCount Basic Question Involving Disc Image(s)

<http://forums.realsoftware.com/viewtopic.php?t=29685>

       Page 1 of 1
   [ 9 posts ]                 Previous topic | Next topic         Author  
Message       rbasic20091005153           Post subject: VolumeCount Basic 
Question Involving Disc Image(s)Posted: Fri Aug 21, 2009 9:58 pm                
               
Joined: Sat Apr 04, 2009 5:10 pm
Posts: 247              Hola.

I have a simple question.  I have an application that allows users to select a 
disc image (DMG, SPARSEBUNDLE, SPARSEIMAGE).  With help of a built-in shell 
app, my app mounts this disc image.  What I want is the volume name of this 
disc image.  After the disc image is mounted, the names of the volumes 
appearing on the desktop will be listed with the following code.

Code:// List volumes
Dim NewVols As FolderItem
Dim jCount As Integer
Dim VolCount,MyLast As Integer

VolCount=VolumeCount-1
For jCount=0 To VolCount
  NewVols=Volume(jCount)
  VolListbox.AddFolder NewVols.Name
  MyLast=VolListbox.LastIndex
Next


I am assuming that the last volume here,

Code:Volume(VolCount)

, always points to the disc image that has just been mounted.  Or is it 
possible that this assumption will not always hold?  If this assumption is 
wrong, then is there a better, firm way of finding out the name of the last 
disc image?

Thank you for your advice.

Tom     
_________________
Mac OS X 10.5.6/REALBasic 2008 R4
I say 'no' to MBS plug-ins.  I boycott them.  
                            Top               DaveS           Post subject: Re: 
VolumeCount Basic Question Involving Disc Image(s)Posted: Fri Aug 21, 2009 
10:02 pm                               
Joined: Sun Aug 05, 2007 10:46 am
Posts: 1452
Location: San Diego, CA              While your assumption may have merit..... 
I would not assume it to always be correct.
It would be better to examine the type of volume... etc via DECLARES to 
determine if it is in fact what you are looking for.
I have some code around here .... but it works only on a MAC

Is that your platform?  or you looking for an cross-platform solution?     
_________________
Dave Sisemore
MacPro, RB2008r3.1  
                            Top               rbasic20091005153           Post 
subject: Re: VolumeCount Basic Question Involving Disc Image(s)Posted: Fri Aug 
21, 2009 10:08 pm                               
Joined: Sat Apr 04, 2009 5:10 pm
Posts: 247              Thanks, Dave.

It's only for Mac.

'Declares' drives me nervous.  I'm afraid I'm not ready for it with just 4 
months of RB experience.     
_________________
Mac OS X 10.5.6/REALBasic 2008 R4
I say 'no' to MBS plug-ins.  I boycott them.  
                            Top               DaveS           Post subject: Re: 
VolumeCount Basic Question Involving Disc Image(s)Posted: Fri Aug 21, 2009 
10:23 pm                               
Joined: Sun Aug 05, 2007 10:46 am
Posts: 1452
Location: San Diego, CA              Let me see what I can find..... 
But I might be able to wrap up a nice pretty function for you     
_________________
Dave Sisemore
MacPro, RB2008r3.1     

    Last edited by DaveS on Fri Aug 21, 2009 10:50 pm, edited 1 time in total.  
 
                            Top               rbasic20091005153           Post 
subject: Re: VolumeCount Basic Question Involving Disc Image(s)Posted: Fri Aug 
21, 2009 10:28 pm                               
Joined: Sat Apr 04, 2009 5:10 pm
Posts: 247              That's very nice of you, Dave.

It's not a hurry.  And, honestly, I don't know if I use it.  I'm thinking about 
covering this confirmation with hdiutil's imageinfo since I probably use it for 
something else.

Good day,

Tom     
_________________
Mac OS X 10.5.6/REALBasic 2008 R4
I say 'no' to MBS plug-ins.  I boycott them.  
                            Top               DaveS           Post subject: Re: 
VolumeCount Basic Question Involving Disc Image(s)Posted: Fri Aug 21, 2009 
10:50 pm                               
Joined: Sun Aug 05, 2007 10:46 am
Posts: 1452
Location: San Diego, CA              Piece of Cake actually 

download this RB Project.... has everything you need

http://www.rdsisemore.com/volumes.rbp     
_________________
Dave Sisemore
MacPro, RB2008r3.1  
                            Top               rbasic20091005153           Post 
subject: Re: VolumeCount Basic Question Involving Disc Image(s)Posted: Fri Aug 
21, 2009 10:56 pm                               
Joined: Sat Apr 04, 2009 5:10 pm
Posts: 247              Gracias, amigo.

So your program can tell whether a volume is 'Internal Drive,' 'External 
Drive,' 'Network Device,' 'DiskImage,' or 'Unknown Type'?  Nice work...  I 
think I can apply it to my app.

Good day,

Tom     
_________________
Mac OS X 10.5.6/REALBasic 2008 R4
I say 'no' to MBS plug-ins.  I boycott them.  
                            Top               DaveS           Post subject: Re: 
VolumeCount Basic Question Involving Disc Image(s)Posted: Sat Aug 22, 2009 
12:05 am                               
Joined: Sun Aug 05, 2007 10:46 am
Posts: 1452
Location: San Diego, CA              Yup....
AND.... if you look in the code you will see an INFOBUFFER.LONG

There is a ton of other data in those bits..... but for the project I extracted 
this from... that information was all I needed...     
_________________
Dave Sisemore
MacPro, RB2008r3.1  
                            Top               rbasic20091005153           Post 
subject: Re: VolumeCount Basic Question Involving Disc Image(s)Posted: Sat Aug 
22, 2009 1:12 am                               
Joined: Sat Apr 04, 2009 5:10 pm
Posts: 247              Solo una mas pregunta, por favor, Dave.

So the last entry appearing on the multi-line EditField is always the volume of 
the disc image that has just been mounted?  If yes, then I suppose this result 
is better than what I get from using Volume(VolCount).

Gracias,

I wonder if Spanish is already the official language of the U.S?     
_________________
Mac OS X 10.5.6/REALBasic 2008 R4
I say 'no' to MBS plug-ins.  I boycott them.  
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 9 posts ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to