Konqueror delete unification

Koos Vriezen koos.vriezen at xs4all.nl
Thu Jul 17 19:13:11 BST 2003


On Wed, 16 Jul 2003, Aaron J. Seigo wrote:

> i'd also not be too worried about the partitions issue in the first stages of
> development. the first step is to make a kio_trash that can handle a single
> dir, then one that can handle multiple dirs and merge the contents as
> appropriate, then one that can move to taking that and making it partition /
> mount aware...

Would be nice to have some commandline utils with it as well. Eg.
trashutils containing trash, trashfind, mktrash and a trash.conf config
file, so that
$ trash -h
'-h' not found
Try `trash --help' for more information.
$ trash --help
Usage: trash [options] [file]
Moves file(s) to trash
Options: -r: restore file(s)
         -i: interactive
         -d: delete from trash
         -t: use custom trash directory
         -f: use custom config file (instead of /etc/trash.conf)
         -e: empty trash (deletes users trash, or all if run as root)
$ trashfind --help
Usage: trashfind [trashoptions] [findoptions]
Searches the trash directories (see find(1) for the findoptions).
Options: -tmax n: File was trashed n hours ago or later.
         -tmin n: File was trashed n hours ago or earlier.
         -f: use custom config file (instead of /etc/trash.conf)
$ mktrash --help
Usage: mktrash <path>
Creates trash directory
$ cat /etc/trash.conf
#
# trash.conf
#
#mounting-point {
#  path = <path to trash dir>
#  default = <bool value> # if true and a fs doesn't have a trash, use
#                         # this one (for multible defaults use with most
#                         # free space)
#  maxfill = <max size>   # eg. 100Mb or 2Gb or 10% (of fs size)
#                         # will auto delete files, starting with first entered
#}
#
# include <other trash.conf>

(interesting after writing this, gg:trash.conf does came with a project,
http://www.yoursitemaster.com/open_source/projects/trashcan/ .. has some
compression too)

Building a kde trash(slave) on top of this, does allow heuristic trashdir
creation if not found in system wide one (using include)
Trash dir would be some kind of tmp dir. For metadata, trash must be suid
for having this file with the same permissions as the trashed one. But all
users can share the same trash dir.
Auto deleting old trash, whoever want that?, is a cron job (or use maxfill)
 trashfind -tmin 240 -exec trash -d \{\} \;
Most important, you don't need kde to use it (/me ducks :) ). Convenient
for those how work mostly in Konsole, use trash for trashing and a gui for
restoring.
(removables and remotes problems remain though)

Koos




More information about the kfm-devel mailing list