Removing Application-Created Items

  • Hi, all,

    I am working on a program that creates a standard preferences plist, a
    subdirectory under Application Support, and a folder for auxiliary
    data that is downloaded (this last one is placed at the top level of
    the user's home directory).  I had a couple of questions:

    1. It valid to set up a menu item, for user convenience, to "reset"
    the program and move any or all of these to the Trash?  I get the
    feeling that the answer is No on the first two items, but I'm not sure
    about the last one.  If the answer to these are "yes, if the files/
    directories are in such-and-such a location," then what sort of
    location would be valid?

    2. I have tried to remove a subdirectory of the auxiliary-downloads
    directory -- this subdirectory being named ".incoming" (with a period
    at the beginning) -- using the following method, but I get an error.
    Is this an example of sandboxing (about which I know very little), and
    if so, what are my options (assuming that I should)?  Note that this
    method worked perfectly, as far as I can figure, on Tiger.  (I just
    recently updated to Leopard and have changed nothing in the following
    method.)

    + (BOOL)deleteFileAtPath:(NSString *)path {
    BOOL success = NO;

    // Moves 'path' to the trash, a la NSWorkspace.
    if ([[[self class] sharedWorkspace]
    performFileOperation:NSWorkspaceRecycleOperation
      source:[path stringByDeletingLastPathComponent]
      destination:@""
      files:[NSArray arrayWithObject:[path lastPathComponent]]
      tag:0])
    {
      success = YES;
    }

    return success;
    }

    Cheers,
    Andrew
  • On Nov 11, 2007, at 10:43 AM, Andrew Merenbach wrote:

    > I am working on a program that creates a standard preferences plist,
    > a subdirectory under Application Support, and a folder for auxiliary
    > data that is downloaded (this last one is placed at the top level of
    > the user's home directory).  I had a couple of questions:
    >
    > 1. It valid to set up a menu item, for user convenience, to "reset"
    > the program and move any or all of these to the Trash?  I get the
    > feeling that the answer is No on the first two items, but I'm not
    > sure about the last one.  If the answer to these are "yes, if the
    > files/directories are in such-and-such a location," then what sort
    > of location would be valid?

    Are you aware that there are both a root level /Library/Application
    Support and a per-user ~/Library/Application Support? For what each is
    for see:

    <http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/ind
    ex.html?http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSy
    stem/Articles/WhereToPutFiles.html
    >

    regards,

    Ralph

    Raffael Cavallaro, Ph.D.
    <raffaelcavallaro...>
  • Hi, Ralpha,

    Thank you for the reference, but I am indeed already aware that there
    are two Application Support and two Preferences directories.  I was
    referring to the ones within the user's home folder.

    Cheers,
    Andrew

    On Nov 11, 2007, at 8:49 AM, Raffael Cavallaro wrote:

    >
    > On Nov 11, 2007, at 10:43 AM, Andrew Merenbach wrote:
    >
    >> I am working on a program that creates a standard preferences
    >> plist, a subdirectory under Application Support, and a folder for
    >> auxiliary data that is downloaded (this last one is placed at the
    >> top level of the user's home directory).  I had a couple of
    >> questions:
    >>
    >> 1. It valid to set up a menu item, for user convenience, to "reset"
    >> the program and move any or all of these to the Trash?  I get the
    >> feeling that the answer is No on the first two items, but I'm not
    >> sure about the last one.  If the answer to these are "yes, if the
    >> files/directories are in such-and-such a location," then what sort
    >> of location would be valid?
    >
    > Are you aware that there are both a root level /Library/Application
    > Support and a per-user ~/Library/Application Support? For what each
    > is for see:
    >
    > <http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/ind
    ex.html?http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSy
    stem/Articles/WhereToPutFiles.html
    > >
    >
    > regards,
    >
    > Ralph
    >
    >
    > Raffael Cavallaro, Ph.D.
    > <raffaelcavallaro...>
    >
previous month november 2007 next month
MTWTFSS
      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    
Go to today