realbasic-nug
[Top] [All Lists]

Re: FolderItem question

To: RBNUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: FolderItem question
From: Seth Duke <seth at johnfinley dot com>
Date: Thu, 29 Jun 2006 13:40:17 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thread-index: AcaboxWKVC00FAeWEduNBgAKlbdaRg==
Thread-topic: FolderItem question
On 6/29/06 1:32 PM, "Craig Hoyt" <craig at aztech4mac dot com> wrote:

> Is it possible to get the folderitem of a file when only the volume
> name and file name are known? This, assuming there is only one file
> with that name on the volume, of course. I'm looking at my options in
> the LR and don't see how to do this. I'm probably missing something
> obvious...
> 
> Craig

Well, if you know the file will be in the root of the volume, you could loop
through the available volumes testing Volume(x).Name for the volume name
then construct the folderitem via Volume(x).Child("filename").

If you have no idea where the file will actually be on the volume, it seems
like you would have to perform a full volume search for the file, which as
you mentioned could cause issues if there happens to be another file with
the same name. I imagine it could also be a fairly time-consuming process on
large volumes.

-Seth
--
<http://www.realopen.org>


_______________________________________________
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>


From  Thu 29 Jun 2006 11:42:37 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
        id 9CCDE727226; Thu, 29 Jun 2006 10:43:40 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on 
        www.realsoftware.com
X-Spam-Level: 
X-Spam-Status: No, score=-1.5 required=4.5 tests=AWL,BAYES_00,NO_REAL_NAME 
        autolearn=no version=3.1.1
Received: from lists.realsoftware.com (lists.realsoftware.com [209.198.132.125])
        by xmail.realsoftware.com (Postfix) with ESMTP id 5E83E727220;
        Thu, 29 Jun 2006 10:43:38 -0700 (PDT)
Received: from lists.realsoftware.com (localhost [127.0.0.1])
        by lists.realsoftware.com (Postfix) with ESMTP
        id EB4A413432AD; Thu, 29 Jun 2006 12:43:25 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from swarthymail-a5.dreamhost.com (sd-green-bigip-98.dreamhost.com
        [208.97.132.98])
        by lists.realsoftware.com (Postfix) with ESMTP id 221B6134329D
        for <realbasic-nug at lists dot realsoftware dot com>;
        Thu, 29 Jun 2006 12:43:20 -0500 (CDT)
Received: from [10.0.1.2] (c-67-174-105-26.hsd1.co.comcast.net [67.174.105.26])
        by swarthymail-a5.dreamhost.com (Postfix) with ESMTP id AABBC109EAF
        for <realbasic-nug at lists dot realsoftware dot com>;
        Thu, 29 Jun 2006 10:43:19 -0700 (PDT)
Date: Thu, 29 Jun 2006 11:42:37 -0600
From: joe at strout dot net
To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
In-Reply-To: <20956673-B86E-466F-9F09-B728B8D2FE91 at aztech4mac dot com>
X-Mailer: VerEx Email Gateway
Content-type: text/plain;
Content-transfer-encoding: 7bit
Message-Id: <20060629174319 dot AABBC109EAF at swarthymail-a5 dot dreamhost dot 
com>
Subject: Re: FolderItem question
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com

On Jun 29, 2006, at 17:32 UTC, Craig Hoyt wrote:

> Is it possible to get the folderitem of a file when only the volume  
> name and file name are known? This, assuming there is only one file  
> with that name on the volume, of course.

Yes, you'll just have to search the entire volume to find it.  That means, for 
example, writing a Find method that takes a FolderItem (which should be a 
directory) and a file name to search for.  It examines all the Items within 
that folder, and if it finds one with a matching name, returns it; and for any 
item that's a directory, it calls Find on it.

Best,
- Joe


--
Joe Strout -- joe at strout dot net
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
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>