Ignore:
Timestamp:
02/15/09 04:44:59 (15 years ago)
Author:
Nicholas Riley
Message:

display alias targets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/launch/launch/main.c

    r477 r490  
    33 Nicholas Riley <launchsw@sabi.net>
    44
    5  Copyright (c) 2001-08, Nicholas Riley
     5 Copyright (c) 2001-09, Nicholas Riley
    66 All rights reserved.
    77
     
    3737const char *APP_NAME;
    3838
    39 #define VERSION "1.1.1d2"
     39#define VERSION "1.1.1d3"
    4040
    4141#define STRBUF_LEN 1024
     
    135135        "'document' may be a file, folder, or disk - whatever the application can open.\n"
    136136        "'item' may be a file, folder, disk, or URL.\n\n");
    137     fprintf(stderr, "launch "VERSION" (c) 2001-06 Nicholas Riley <http://web.sabi.net/nriley/software/>.\n"
     137    fprintf(stderr, "launch "VERSION" (c) 2001-09 Nicholas Riley <http://web.sabi.net/nriley/software/>.\n"
    138138                    "Please send bugs, suggestions, etc. to <launchsw@sabi.net>.\n");
    139139
     
    901901        printMoreInfoForRef(fsr);
    902902    }
     903
     904    // alias target (note: may modify fsr and url)
     905    if (info.flags & kLSItemInfoIsAliasFile && haveFSRef) {
     906        Boolean targetIsFolder, wasAliased;
     907        err = FSResolveAliasFileWithMountFlags(&fsr, false, &targetIsFolder, &wasAliased, kResolveAliasFileNoUI);
     908        if (err != noErr)
     909            printf("\t[can't resolve alias: %s]\n", osstatusstr(err));
     910        else if (wasAliased) {
     911            url = CFURLCreateFromFSRef(NULL, &fsr);
     912            if (url != NULL) {
     913                printf("\ttarget: ");
     914                printPathFromURL(url, stdout);
     915                CFRelease(url);
     916            }
     917        }
     918    }
    903919}
    904920
Note: See TracChangeset for help on using the changeset viewer.