Professional Web Applications Themes

FSGetCatalogInfo different behaviour under Classic and MacOs9 - Mac Programming

Hello, I get some FSRef out of my Navigation Reply. If I iterate the nodes for obtaining the unicode path like this -> while(err == noErr && noErr == FSGetCatalogInfo( &ref, kFSCatInfoNone, NULL,NULL,NULL,NULL) )) { HFSUniStr255 outName; err = FSGetCatalogInfo( &ref, kFSCatInfoNone, NULL, &outName, NULL,NULL); err = FSGetCatalogInfo( &ref, kFSCatInfoNodeID, &catalogInfo, NULL,NULL, &ref); if (( err == noErr ) && ( fsRtDirID == catalogInfo.nodeID )) { memset(&ref, 0, sizeof(FSRef)); } } I only get the filename (not the whole path) when running under MacOS9 and the file resides on a server volume. It seems, that FSGetCatalogInfo() from the while clause ...

  1. #1

    Default FSGetCatalogInfo different behaviour under Classic and MacOs9

    Hello,

    I get some FSRef out of my Navigation Reply.
    If I iterate the nodes for obtaining the unicode path like this ->

    while(err == noErr &&
    noErr == FSGetCatalogInfo(
    &ref,
    kFSCatInfoNone,
    NULL,NULL,NULL,NULL) ))
    {
    HFSUniStr255 outName;

    err = FSGetCatalogInfo(
    &ref,
    kFSCatInfoNone,
    NULL,
    &outName,
    NULL,NULL);

    err = FSGetCatalogInfo(

    &ref,
    kFSCatInfoNodeID,
    &catalogInfo,
    NULL,NULL,
    &ref);

    if (( err == noErr ) && ( fsRtDirID == catalogInfo.nodeID ))
    {
    memset(&ref, 0, sizeof(FSRef));
    }
    }

    I only get the filename (not the whole path) when running under MacOS9
    and the file resides on a server volume. It seems, that
    FSGetCatalogInfo() from the while clause returns errFSBadFSRef the
    second time around.
    In a classic box, all behaves as wanted...

    Is there a trick or workaround or do I have to change my strategy for
    MacOS9?

    - Michael
    Michael Guest

  2. #2

    Default Re: FSGetCatalogInfo different behaviour under Classic and MacOs9

    Michael Fielitz <com> wrote:
     


    Hello again,

    I still got no solution for getting FSGetCatalogInfo() working on MacOS
    9.
    And this doesn't work either (It's a snippet from File Buddy's developer
    section <http://www.skytag.com/developer/FSSpecFSRef.html>):

    do {
    HFSUniStr255 name;

    err = FSGetCatalogInfo( &localRef,
    kFSCatInfoNodeID, &info,
    &name, nil, &localRef );
    if ( err == noErr )
    names.push_back( name );
    } while ( err == noErr && info.nodeID != fsRtDirID );

    So I think the best is to find out the environment I'm running on (via
    Gestalt) and switch to FSRefMakePath() as appropriate. This will only
    work for non-UNICODE paths, but I think that this won't make any
    difference in good old Mac OS 9...

    Michael
    Michael Guest

  3. #3

    Default Re: FSGetCatalogInfo different behaviour under Classic and MacOs9

    On Wed, 12 Nov 2003, Michael Fielitz wrote:
     
    What error are you getting? Is your FSRef valid? And i don't see what you
    expect to accomplish with this code, as you are not changing the value of
    localRef. Maybe you need something like FSGetCatalogInfoBulk

    Fred
     

    Frederick Guest

  4. #4

    Default Re: FSGetCatalogInfo different behaviour under Classic and MacOs9

    Frederick Cheung <DUH.ucam.org> wrote:
     
    > What error are you getting? Is your FSRef valid?[/ref]

    Of course, not - in fact, this is the problem...
    FSGetCatalogInfo() returns errFSBadFSRef when called with the returned
    parentRef from the first call.
     

    It should be changed, as the last parameter will return the object's
    parent directory. Maybe I better use a different variable for this?
     

    I thought, this is for iterating over files in a directory, so I don't
    see any use for my purpose.

    Michael
    Michael Guest

  5. #5

    Default Re: FSGetCatalogInfo different behaviour under Classic and MacOs9

    On Thu, 13 Nov 2003, Michael Fielitz wrote:
     
    > > What error are you getting? Is your FSRef valid?[/ref]
    >
    > Of course, not - in fact, this is the problem...
    > FSGetCatalogInfo() returns errFSBadFSRef when called with the returned
    > parentRef from the first call.[/ref]
     
    >
    > It should be changed, as the last parameter will return the object's
    > parent directory. Maybe I better use a different variable for this?[/ref]

    Sorry, i wasn;t reading your code properly. It would be worth trying using
    a different variable. You seem to be just trying to get an object's path,
    why not use one of the APIs that does that for you?
     
    >
    > I thought, this is for iterating over files in a directory, so I don't
    > see any use for my purpose.
    >[/ref]
    It is, i misunderstood what you were trying to do.

    Fred

    Frederick Guest

Similar Threads

  1. Converting from v9 on MACOS9 to Windows 2000 v10
    By Mark_Blackstock@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 2
    Last Post: August 6th, 02:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139