nsIFile.remove should allow option to send to Recycle Bin/Trash

UNCONFIRMED
Unassigned

Status

()

--
enhancement
UNCONFIRMED
13 years ago
a year ago

People

(Reporter: mimecuvalo, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3

It would be good that nsIFile has the ability to move a file to the OS's Recycle Bin/Trash.  Or, alternatively, the "Trsh" folder is defined in http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsDirectoryServiceDefs.h but only for the Mac.  It would be good to have access to Linux and Windows as well for cross-platform development abilities.  

The practical use for this is, in my case, I'm developing FireFTP and it acts partially as a File Manager.  Currently when deleting files, the user must permanently delete them.

Reproducible: Always
(Reporter)

Comment 1

8 years ago
I've added this to FireFTP now via jsctypes.  See http://www.mozdev.org/source/browse/fireftp/src/content/js/local/localFile.js.diff?r1=1.29;r2=1.30;f=h

I still think this should maybe be a part of the core API though.
(Reporter)

Updated

8 years ago
Component: XPCOM → Networking: File
QA Contact: xpcom → networking.file

Updated

8 years ago
Severity: normal → enhancement
Component: Networking: File → XPCOM
QA Contact: networking.file → xpcom
Note that this (in *nix world) is highly DE specific (on win+mac, there's only one DE).
Also think of cases like remote filesystems, etc.

I doubt you wanna implement poper handling for all these individual cases (and the
required customizability) into moz core.

As that's a quite common topic (for all kind of file managing applications), I'd
suggest moving that to an entirely separate library, which can be easily patched
or replaced by distros / operators.
You need to log in before you can comment on or make changes to this bug.