Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jim2step

macrumors newbie
Original poster
Apr 25, 2005
1
0
Can I safely assume that a file in the trash cannot be accessed by an application?

Cheers,
Jim
 

mad jew

Moderator emeritus
Apr 3, 2004
32,191
9
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. :)
 

gangst

macrumors 6502a
Dec 27, 2004
614
0
UK
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
 

840quadra

Moderator
Staff member
Feb 1, 2005
9,465
6,366
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.
 

HexMonkey

Administrator emeritus
Feb 5, 2004
2,240
504
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.