home *** CD-ROM | disk | FTP | other *** search
- /* CleanRAMdisk.dopus V1.0
- written in 1994 by Roland Schwingel
- Lilienthalstraße 9
- 92421 Schwandorf
- Germany
-
- Description:
- Erases all files and subdirs within "RAM:" or "Ram Disk:" except:
- - Clipboards/
- - ENV/
- - T/
- - Disk.info
-
- **** USE ENTIRELY AT YOUR OWN RISK ! ****
- */
-
- /* ----------------------- main routine --------------------- */
- options results /* need results */
-
- parse arg portname
- if portname~=='' then
- address(portname)
- else
- portname=address()
-
- 'busy on' /* busy mouse pointer on */
- call get_win_and_path
-
- if((diskname~=='RAM:') & (diskname ~== 'RAM DISK:')) then
- do
- /* This window contains no ramdisk look into the other window*/
- 'otherwindow'
- call get_win_and_path
-
- if((diskname ~== 'RAM:') & (diskname ~== 'RAM DISK:')) then
- do
- /* Also no Ramdisk in other window*/
- 'otherwindow' /* back to first active window */
- call get_win_and_path
- 'ScanDir RAM: ' || win /* read Ramdisk */
- call cleandisk
- 'ScanDir "' || oldpath || '" ' || win /* read old directory */
- end
- else
- do
- /* This window is Ramdisk */
- call cleandisk
- 'otherwindow'
- end
- end
- else
- /* window with ramdisk found */
- call cleandisk
-
- 'busy off' /* busy mousepointer off */
- exit
-
- /* ------------------------ Get path and window ------------- */
- get_win_and_path:
- 'status 3' /* get active window number */
- win=result
-
- 'status 13 ' || win /* get path of Window */
- oldpath=result
- diskname=upper(oldpath)
- return
-
- /* ------------------------- clean disk --------------------- */
- cleandisk:
- 'None' /* clear possible selection */
- 'Select ~(Clipboards|ENV|T|Disk.info) name'
- 'Delete' /* get rid of it */
- return
-
-