[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] MacPerl::LoadExternals("FindFolder.pl"): File notfound..



I must say, I like some of the features of perl5, like objects and syntax cleanups, but a lot of basic stuff is sure gotten to be incomprehensible
and impossible to track down with all this dynaloader, loadexternals, exporters, ....

(And I do appreciate your help even I sound frustrated.)

>># MacPerl::LoadExternals("FindFolder.pl"): File not found..
>>File '...:MacPerl 5.14r4:lib:FindFolder.pl'; Line 3
>>
>>I thought I did the install uneventfully, but any ideas of what I should do?
>
>Hm.  I don't know about the error, but use Mac::Files and its FindFolder() 
>function instead.  It is documented in the Files.pm file.

OK, leaving aside the fact that the new 'FindFolder.pl' doesn't work (see
above).  How in heavens name does one figure out how to use Mac::Files and
Files.pm?

Here's the pod documentation for Files.pm (plus Files.xs):

-=-=-
FindFolder VREF, FOLDERTYPE [, CREATE]	
Returns a path to a special folder on the given volume (specify kOnSystemDisk for the boot volume). Values for FOLDERTYPE are 
-=-=-

Note that the pod is cut off in the middle of the sentence.  Looking deeper
into Files.xs is the source for this:
-=-=-
=item FindFolder VREF, FOLDERTYPE [, CREATE]

Returns a path to a special folder on the given volume (specify 
C<kOnSystemDisk> for the boot volume). Values for FOLDERTYPE are

=cut
FSSpec
FindFolder(vRefNum, folderType, createFolder=0)
    short   vRefNum
    OSType  folderType
    Boolean     createFolder
    CODE:
    if (gLastMacOSErr = FindFolder(vRefNum, folderType, createFolder, &RETVAL.vRefNum, &RETVAL.parID)) {
        XSRETURN_UNDEF;
    }
    FSpUp(&RETVAL);
    OUTPUT:
    RETVAL
-=-=-

What are the values for VREF and FOLDERTYPE?  Looking in Files.pm and in
Files.xs is NOT exactly enlightening, and it seems silly that I would have
to become an expert in C coding of the Macintosh filesystem to do this
thing that used to work in earlier versions of the perl library.

So stabbing blindly around in the dark, I tried:

use Mac::Files;
$desktop = &Mac::Files::FindFolder(&Mac::Files::kOnSystemDisk(), "D");
print "$desktop\n";

But this prints a newline only.

All I really want is what FindFolder.pl orginally did: return the
string file path spec to me, so I can look for or create a file in
the desktop folder.


_______
Will Neuhauser              willn@quando.com
Chief Technical Officer, VP Development
Quando, Inc.                Tel: 1 (503) 225-1988
520 NW Davis Street         Fax: 1 (503) 225-1987
Portland, OR  97209 USA



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch