realbasic-nug
[Top] [All Lists]

Re: Is a volume?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Is a volume?
From: "Peter E. Barck" <sirujo at bu dot edu>
Date: Fri, 31 Dec 2004 14:14:02 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <77295313041230184029d21765 at mail dot gmail dot com> <ED8B01F8-5AD9-11D9-964A-000393786770 at realsoftware dot com>
I believe that if the Parent property is nil, the folderitem is a volume.

On Dec 30, 2004, at 8:40 PM, Dave wrote:

How would I check if a folderitem is a volume?
--
Geoff Perlman
President and CEO
REAL Software, Inc.

I have been using the following simple loop to get a Volume Name. Here "myFolderItem" is the FolderItem where you want to find its root Volume. At the end f1 is the Root Volume FolderItem, which for your home folder is equivalent Volume(0)

  Dim f1, f2 As FolderItem
  f1 = myFolderItem
  Do
    f2 = f1.Parent
    if f2 = Nil Then
      Volume_Name = f1.Name
      exit
    end if
    f1 = f2
  Loop

I hope this helps.  Have a wonderful New Year.

--
   Cheers,
   Peter

   TI PowerBook  G4, 1.GHz, 1GB RAM, OSX 10.3.4, RB 5.5.4
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>