Can an application access files from the trash?

Discussion in 'Mac Basics and Help' started by jim2step, Apr 25, 2005.

  1. jim2step macrumors newbie

    Apr 25, 2005
    Can I safely assume that a file in the trash cannot be accessed by an application?

  2. mad jew Moderator emeritus

    mad jew

    Apr 3, 2004
    Adelaide, Australia
    Short answer: yeah I don't think most apps will be able to use files in the trash.

    Long answer (but a little unsure about this): since the Finder is technically an app, I don't see what's stopping some hella good programmer writing an app that can also use the trash but I don't see the point and I'm not all sure it's possible.

    In short, yes. :)
  3. gangst macrumors 6502a

    Dec 27, 2004
    yes, I don't think I have ever came across an app that can access from the trash, yet I wouldn't say its impossibe
  4. 840quadra Moderator


    Staff Member

    Feb 1, 2005
    Twin Cities Minnesota
    Sorta yes

    I have run applications that can put items into the trash, but I don't think I have ever accessed a program that way..

    I have also put active desktop items in my trash (ie VLC Media player) and the program continued to run just fine. However I couldn't empty the trash with the program running.
  5. HexMonkey Administrator


    Staff Member

    Feb 5, 2004
    New Zealand
    Actually it's very easy to open files in the trash. Normally when you double click a file, Finder examines the file to see which application to open it in, and then tells the application to open it. If it's in the Trash, it will give an error message.

    However, if you bypass Finder, they can be opened very easily. For example, if you have TextEdit in the dock, you could drag a text document to it and it would open (note that dragging a file to an application's icon in Finder would not work, because Finder can still intervene). Alternatively, you could choose File->Open from an application, drag a file from the trash in Finder to the open panel (which selects the file in the open panel), and open it.

    Even without a specific request to open a file, applications can very easily read files from the trash, and even write to them. So although Finder will try to prevent you from opening a file from the trash, very few other applications will, and you can't assume the files are inaccessible.

Share This Page