| 
									
										
										
										
											2008-11-14 01:25:00 -05:00
										 |  |  | ! Copyright (C) 2008 Doug Coleman. | 
					
						
							|  |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							|  |  |  | USING: accessors calendar.format combinators io.files | 
					
						
							| 
									
										
										
										
											2008-12-02 22:49:59 -05:00
										 |  |  | kernel math.parser sequences splitting system tools.files | 
					
						
							| 
									
										
										
										
											2008-12-16 03:51:57 -05:00
										 |  |  | generalizations tools.files.private io.files.info ;
 | 
					
						
							| 
									
										
										
										
											2008-12-02 22:49:59 -05:00
										 |  |  | IN: tools.files.windows | 
					
						
							| 
									
										
										
										
											2008-11-14 01:25:00 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-14 01:51:14 -05:00
										 |  |  | <PRIVATE
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-14 01:25:00 -05:00
										 |  |  | : directory-or-size ( file-info -- str )
 | 
					
						
							|  |  |  |     dup directory? [ | 
					
						
							|  |  |  |         drop "<DIR>" 20 CHAR: \s pad-right | 
					
						
							|  |  |  |     ] [ | 
					
						
							|  |  |  |         size>> number>string 20 CHAR: \s pad-left | 
					
						
							|  |  |  |     ] if ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: windows (directory.) ( entries -- lines )
 | 
					
						
							|  |  |  |     [ | 
					
						
							|  |  |  |         dup file-info { | 
					
						
							|  |  |  |             [ modified>> timestamp>ymdhms ] | 
					
						
							|  |  |  |             [ directory-or-size ] | 
					
						
							|  |  |  |         } cleave 2 narray swap suffix " " join
 | 
					
						
							|  |  |  |     ] map ;
 | 
					
						
							| 
									
										
										
										
											2008-11-14 01:51:14 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | PRIVATE>
 |