Code covered by the BSD License  

Highlights from
Recycle Bin

1.0

1.0 | 1 rating Rate this file 2 Downloads (last 30 days) File Size: 4.12 KB File ID: #4856

Recycle Bin

by Fahad Al Mahmood

 

03 May 2004 (Updated 08 Jun 2004)

Works like (delete) for files except for moving files to selected folder with restoring.

| Watch this File

File Information
Description

trash file(s)
moves file(s) to Recycle Bin folder, Recycle Bin folder will be created if necessary).

RecycleBin file(s) flag
FLAG can be:
  -ls : lists contents of Recycle Bin.
  -r : restores selected file to original directory. Wildcard works only when no multiple copies of same file are trashed.
  -rc : restore file(s) to current directory. Wildcard works only when no multiple copies of same file are trashed.
  -e : deletes files from Recycle Bin folder and deletes the folder afterwards if all files are deleted.
  -o : deletes older versions of specified trashed file (no wildcard allowed)
  -log: view "trash.log" file.
  -size : displays number of objects & total size

trash : works like (delete) except for moving files to selected (Recycle Bin) folder. If not specified, the default (Recycle Bin) folder will be created in current directory.

NOTES:
* Make sure you specify the path of your Recycle Bin folder by editing the first line of the script!

* wildcard can be used for trashing files, trash options (ls), but NOT (old). For restore, wildcard works only if no multiple copies of same file are trashed.

* this program has been tested only on (Windows) but not on (UNIX)!
          
Examples:

trash myfile.m % Trashing one file.
trash myfile.m myotherfile.exe % Trashing 2 files
trash -ls % Listing files in Recycle Bin
trash *.exe -ls % Listing files in trash with extention (exe).
trash file.xls -o % Deleting old versions of (file.xls) and keeping the latest one.
trash *.exe -r % Restoring (*.exe) to original directory.
trash myfile.m -rc % Restoring (myfile.m) to current directoty.
trash -e % Emptying Recycle Bin
trash file.m -e % Deleting (file.m) from the Recycle Bin
trash -size % Displaying number of files & total size in Recycle Bin

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
27 Oct 2005 Aaron Stewart  
Please login to add a comment or rating.
Updates
08 Jun 2004

Added size feature + Fixed restore log bug + Function renamed to (trash)

Tag Activity for this File
Tag Applied By Date/Time
path Fahad Al Mahmood 22 Oct 2008 07:18:52
directories Fahad Al Mahmood 22 Oct 2008 07:18:52
files Fahad Al Mahmood 22 Oct 2008 07:18:52
recycle bin Fahad Al Mahmood 22 Oct 2008 07:18:52
recover Fahad Al Mahmood 22 Oct 2008 07:18:52
restore Fahad Al Mahmood 22 Oct 2008 07:18:52
delete Fahad Al Mahmood 22 Oct 2008 07:18:52
recover Laura 19 Feb 2011 09:31:16

Contact us at files@mathworks.com