Guidance
指路人
g.yi.org
Upload / Forum Attachment / Reginald Rexx Programming Language Compiler User Forum Attachments and Pictures / 12542-reclaim gigabaytes.rex

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
/***************************************************************/ 
/* FIND BIG FILES */ 
/* */ 
/* Displays all files on an Windows XP machine, from largest */ 
/* to smallest, for easy identification of big obsolete files. */ 
/* */ 
/* Recursively traverses the directory tree. */ 
/* */ 
/***************************************************************/ 
sort_file = 'c:\andy\zz_sortin.txt' 
/* Full DIR listing is here */ 
output_file = 'c:\andy\zz_sortout.txt' 
/* SORTed DIR listing is here */ 
'erase' sort_file output_file  
/* Ensure files used are new */ 
CALL list_files 1,'C:\' 
/* Process the topmost directory */ 
rc = LINEOUT(sort_file) 
/* Close the output file */ 
'sort /+1 /r ' sort_file '/o' output_file 
/* Sort it by Size */ 
'wordpad' output_file 
/* Let user view the big files */ 
EXIT 0 
/* End the program */ 


 
list_files: PROCEDURE EXPOSE sort_file 
iteration = ARG(1) /* Pick up the 2 input arguments,*/ 
search_dir = ARG(2) /* these are the Iteration # and */ 
/* the Directory to search */ 
more_to_process = 'YES' 
/* Set the processing flag on */ 
/* Do while there are more files & directories to process */ 
DO WHILE more_to_process = 'YES' 
/* MATCHNAME returns the next file or sub-directory name */ 
result = MATCHNAME(iteration, 'feedback', search_dir, 'DSNHCRAT', 'NS')
IF result \= "" /* Stop if MATCHNAME says to */ 
THEN more_to_process = 'NO' 
ELSE DO /* MATCHNAME returned an entry */ 
/* This case is a File name, write it to the output list */ 
IF feedback.0 \= "" THEN DO 
out_line = FORMAT(feedback.0, 15) search_dir || feedback 
rc = LINEOUT(sort_file, out_line) 
END 
/* This case is a new sub-Directory to process. Process */ 
/* the sub-Directory by calling LIST_FILES routine */ 
ELSE DO 
new_search_path = search_dir || feedback || '\' 
result = list_files((iteration + 1), new_search_path) 
END 
END 
END 
RETURN result
 	 
	 
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-6-21  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2008-12-02 15:16:16