Professional Web Applications Themes

How to do a "what folder do I live in?" query? - Mac Programming

Removed by Administrator...

  1. Moderated Post

    Default How to do a "what folder do I live in?" query?

    Removed by Administrator
    Don Guest
    Moderated Post

  2. #2

    Default Re: How to do a "what folder do I live in?" query?

    In article <tHt%b.4006$sonic.net>,
    Don Bruder <net> wrote:
     

    This is a bad idea. The app might be on a CD. The app might be on a read-only
    server. The user might not be permitted to write to the folder, perhaps due to
    lack of admin privileges (even on Mac OS 9).

    You should let the user select a location, and you should save the location in
    your preferences if you want to find it easily next time. CFPreferences make it
    _trivial_ to do this, but you say you are not using Carbon, so you should just
    create a file in the Preferences folder (FindFolder, FSMakeFSSpec,
    FSpCreateResFile) and write an alias to the saved file there (FSpCreateAlias,
    AddResource, CloseResFile). It's really not that hard.

    All that said, GetCurrentProcess and GetProcessInformation will tell you what
    you ask.

    hth

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  3. #3

    Default Re: How to do a "what folder do I live in?" query?

    In article <tHt%b.4006$sonic.net>,
    Don Bruder <net> wrote:
     

    Try PBGetFCBInfo with ioFCBIndx set to zero <http://developer.apple.com/doentation/mac/Files/Files-297.html>

    It does not return a FSSpec, but the info to make a FSSpec is there.

    Reinder
    Reinder Guest

  4. #4

    Default Re: How to do a "what folder do I live in?" query?

    In article <mit.edu>,
    Miro Jurisic <org> wrote:
     [/ref]

    <snip>
     

    Thanks. From a quick glance at GetProcessInformation, it looks as though
    that's got me covered.

    --
    Don Bruder - net - New Email policy in effect as of Feb. 21, 2004.
    For info on this, see <http://www.sonic.net/~dakidd/main/contact.html> Short
    form: I'm trashing EVERYTHING that doesn't contain a specific, rotating phrase
    in the subject line. Sorry, but spammers have forced me to take this action.
    Don Guest

  5. #5

    Default Re: How to do a "what folder do I live in?" query?

    In article <tHt%b.4006$sonic.net>, Don Bruder
    <net> wrote:
     

    That's bad practice and there's no excuse: FindFolder() goes back to
    InterfaceLib 7.1. Use it to locate an appropriate location.

    * FindFolder()
    *
    * Availability:
    * Mac OS X: in version 10.0 and later in
    CoreServices.framework
    * CarbonLib: in CarbonLib 1.0 and later
    * Non-Carbon CFM: in InterfaceLib 7.1 and later
    Chris Guest

  6. #6

    Default Re: How to do a "what folder do I live in?" query?

    In article <acw%b.4049$sonic.net>,
    Don Bruder <net> wrote:
     

    Just to say it again, your strategy is bad practice and failure-prone.
    There's not much reason not to save the file wherever the user
    specifies, and you can still find it again afterwards with a small
    amount of extra work.

    Of course, it's entirely up to you.
    Michael Guest

  7. #7

    Default Re: How to do a "what folder do I live in?" query?

    In article <mail-9F4364.11513827022004localhost>,
    Michael Ash <com> wrote:
     
    >
    > Just to say it again, your strategy is bad practice and failure-prone.
    > There's not much reason not to save the file wherever the user
    > specifies, and you can still find it again afterwards with a small
    > amount of extra work.
    >
    > Of course, it's entirely up to you.[/ref]

    You're correct. It's entirely up to me, and I really get tired as hell
    of somebody, whether it's me or whoever else, asking a question, only to
    have everybody and his dog jump in with the "that's bad practice" sermon.

    I didn't ask if it was bad practice. I didn't ask if it was good
    practice. I asked if there was a way to do it. If you've got the answer,
    great, send it along. But spare me the religious debate over whether
    it's good, bad, or otherwise.

    Good lord, people... You'd think this was a Microsoft group - "Thou
    shalt not do this, thus, or so, lest thou surely die!" What's next?
    "Thous shalt do it this way only, or face the wrath of Steve?"

    Whatever happened to "think different"? Never mind - I KNOW what
    happened to it: It got pummeled to death by folks wielding "That's bad
    practice" bludgeons.

    And yet we still sit around wondering why there are so few Mac-targeted
    programs showing up any more...

    --
    Don Bruder - net - New Email policy in effect as of Feb. 21, 2004.
    For info on this, see <http://www.sonic.net/~dakidd/main/contact.html> Short
    form: I'm trashing EVERYTHING that doesn't contain a specific, rotating phrase
    in the subject line. Sorry, but spammers have forced me to take this action.
    Don Guest

  8. #8

    Default Re: How to do a "what folder do I live in?" query?

    In article <w8G%b.4146$sonic.net>, net
    says... 

    When someone comes along via Google months later wanting an answer to a
    similar problem they might appreciate the reasons given why the original
    course of action may not be ideal and they might appreciate the
    suggested alternatives even more.

    If you carefully consider the possible downsides and come to the
    conclusion that they won't affect your particular cirstances then
    great - be happy with the answer you were given. Someone else might have
    just have avoided a bug because they've had a possible pitfall they
    hadn't considered pointed out to them.
    James Guest

  9. #9

    Default Re: How to do a "what folder do I live in?" query?

    Don Bruder wrote: 

    what *i* get tired as hell of is people like you, failing to listen to
    reasons why what you're doing is bad practice.

    you poor widdle thing! people trying to point out that you're writing
    kludgy, stupid programs! the nerve!
     

    what a GIGANTIC load of crap.

    if this flood of mac programs you think we're holding back would come
    from the likes of you, then i'm glad you and the rest of your ilk are
    staying away.
    Jhnny Guest

  10. Moderated Post

    Default Re: How to do a "what folder do I live in?" query?

    Removed by Administrator
    Doc Guest
    Moderated Post

  11. #11

    Default Re: How to do a "what folder do I live in?" query?

    In article <supernews.com>,
    Doc O'Leary <com> wrote:

     
    >
    > Look, you got the information you wanted along with a generous
    > suggestion[/ref]

    You misspelled "sermon".
     

    Don't worry, Doc... It's a special-purpose item that's not likely to be
    used by anyone but me, and is even less likely to see the light of day
    unless someone burglarizes my home and starts posting copies of it to
    the 'net from my stolen hard drive. Assuming it IS stolen and posted
    online, it's still going to be worthless, since it's eventually going to
    be a controller and data-logger for a custom-built and programmed (by
    yours truly) pile of electronics that I think it incredibly unlikely
    anyone else on the planet is going to have a use for. (if they can even
    get their hands on the piece of obsolete hardware it's intended to
    control and monitor, that is...)

    Now, knowing that, would you care to tell me again why I care if anybody
    else can/can't figure out how to use it, or how badly it might break
    *The Rules*?

    Yeesh... Ask a simple question, get a friggin' sermon... You're right...
    perhaps it's best if I just give up asking anything around here. God
    forbid I might offend someone by publishing a data-logging program and
    expecting the user to have the smarts to actually put it on their HD
    before trying to run it...

    Here's the ball, guys... pick it up and run with it if you want. I'm
    done with this thread.

    --
    Don Bruder - net - New Email policy in effect as of Feb. 21, 2004.
    For info on this, see <http://www.sonic.net/~dakidd/main/contact.html> Short
    form: I'm trashing EVERYTHING that doesn't contain a specific, rotating phrase
    in the subject line. Sorry, but spammers have forced me to take this action.
    Don Guest

  12. #12

    Default Re: How to do a "what folder do I live in?" query?

    In article <w8G%b.4146$sonic.net>,
    Don Bruder <net> wrote:
     

    First of all, there is no debate. It's bad.

    Second, your question and my answer will be preserved essentially forever (in
    Google). I therefore owe it not just to you, but to every single person who
    might ever read your question and my answerto provide an answer that is
    applicable to the more general audience than you.

    Third, in my experience, there is no such thing as throwaway code, and there is
    not such thing as a project for personal use only. Sooner or later, practically
    every piece of code finds its way into another project, via copy and paste, and
    when that occurs, the unspoken assumptions of the original code are _not_
    carried along. Often, not even the explicit assumptions, stated in comments, are
    carried along. "I am going to do it wrong just this once, because this code will
    never be used anywhere else" is a rationalization that sounds nice and almost
    never works in reality (over a long period of time). As a result, I firmly
    believe in doing the minimum amount of work it takes to do the right thing.

    hth

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  13. #13

    Default Re: How to do a "what folder do I live in?" query?

    Don Bruder wrote: 

    You might get tired of it, but that pressure is one of the things that
    makes the Mac a better environment for users than other platforms.
    Believe me, you'll get much more pushback from your users if this is a
    mass-market app than you've gotten from the participants in this newsgroup.

    -jcr
    John Guest

  14. #14

    Default Re: How to do a "what folder do I live in?" query?

    ....i'm on don's side on this one. sometimes it seems like
    in macland the simplest questions are the hardest to get a
    direct answer to, especially for someone who is trying to
    deal directly with hardware. write directly to the display
    without going through the windowing system, turn off interrupts?
    a transgression! there sometimes is an odd sort of political
    correctness, "human interface guidelines" run amok. frustration
    at being lectured to can build up over the years, leading to a rant
    (like now).

    really, isn't it reasonable to keep the data file next to the
    application, and isn't a preferences file superfluous
    in a one-off oddball hardware project?

    i'd like to believe that space aliens from the future are going
    to google the newsgroups to learn the pure path of mac coding,
    but i have my doubts. i don't mind opinion mixed in with actual
    useful information, but sometimes get annoyed at posts that are
    pure opinion (like this one).

    have a good weekend!

    rob
    rob Guest

  15. #15

    Default Re: How to do a "what folder do I live in?" query?

    In article <w8G%b.4146$sonic.net>,
    Don Bruder <net> wrote:
     

    If you don't want well-meant advice that you get her *for free*, that's
    fine with me. This is a public newsgroup. Other people will read these
    messages in archives. Just because something is on a thread you started,
    doesn't mean the whole world revolves around you.

    I usually shy away from a menu item that says 'Kill this author...', but
    for Mr. "You misspelt 'sermon'" I'll make an exception. Or put more
    politely than MT-Newswatcher says it:

    * PLONK *

    -- M. Uli Kusterer
    http://www.zathras.de
    Uli Guest

  16. #16

    Default Re: How to do a "what folder do I live in?" query?

    In article <cybermesa.com>,
    com (rob shaw) wrote:
     

    I don't recall seeing people bothered if they prefix their post with
    something like, "I know this is generally the wrong thing to do, but I
    have good reasons for it...." Without a disclaimer like that, the
    assumption is that the poster is ignorant of the problem with his idea,
    not that he is aware of it and posting anyway. People in general easily
    get fixed on a particular way of solving their problem, and then end up
    asking the wrong question.
    Michael Guest

  17. #17

    Default Re: How to do a "what folder do I live in?" query?

    In article <260220042136097873%net>,
    Chris Baum <net> wrote:
     
    >
    > That's bad practice and there's no excuse: FindFolder() goes back to
    > InterfaceLib 7.1.[/ref]

    Goes back even further than that. It's just that before InterfaceLib 7.1
    there were only 68k machines.

    G
    Gregory Guest

  18. #18

    Default Re: How to do a "what folder do I live in?" query?

    In article <cybermesa.com>,
    com (rob shaw) wrote:
     

    Did Don not get a direct answer to his question in the very first
    response?
     

    Not in the general case, no. It's not safe. It hasn't been safe since
    the Mac Plus shipped. For what Don eventually revealed his goal was,
    fine. But the key word is eventually. He started out with a post that
    could be read as indicating that someone other than him might use the
    program.

     

    Your doubts are unfounded. Just this week I got mail from someone asking
    me to clarify and expand on a post I made two years ago.

     

    If Don had expressed annoyance with an opinion, it probably would have
    passed with little notice. But it wasn't an opinion and it wasn't a
    simple expression of annoyance. He responded to well-founded,
    well-intentioned advice with an insulting rant.
    Gregory Guest

  19. #19

    Default Re: How to do a "what folder do I live in?" query?

    In article <HFM%b.4203$sonic.net>,
    Don Bruder <net> wrote:
     

    I don't understand how that follows. Please explain to me why a user
    would expect that a data logging program must run from a writeable
    location or why making that assumption would be an indication of
    "smarts." One could just as well argue that someone might have the
    smarts to not bother copying a program off the CD until they know
    they're going to keep it, yeah?
    Gregory Guest

  20. #20

    Default Re: How to do a "what folder do I live in?" query?

    In article <cybermesa.com>,
    com (rob shaw) wrote:
     

    It is likely reasonable if an *experienced* developer thinks it it
    reasonable. But an experienced developer would *not* have to ask here
    how to do it! Therefore, it absolutely makes sense to educate newbie
    question askers beyond the surface question posted.
    Doc Guest

Page 1 of 2 12 LastLast

Similar Threads

  1. Stream still "playing live" after close called
    By Rich_in_the_UK in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: October 18th, 02:57 PM
  2. ColdFusion+cfquery+Oracle+CLOB+"Query of Query"
    By ferse in forum Coldfusion Database Access
    Replies: 0
    Last Post: April 25th, 01:28 PM
  3. cfgrid inside a <cfoutput query="myQuery" group="GROUP">
    By DavidGhous in forum Coldfusion Flash Integration
    Replies: 1
    Last Post: April 12th, 07:23 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