| 
									
										
										
										
											2008-10-07 00:02:06 -04:00
										 |  |  | ! Copyright (C) 2008 Doug Coleman. | 
					
						
							|  |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							|  |  |  | USING: kernel alien.syntax math io.unix.files system | 
					
						
							|  |  |  | unix.stat accessors combinators calendar.unix ;
 | 
					
						
							|  |  |  | IN: io.unix.files.bsd | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TUPLE: bsd-file-info < unix-file-info birth-time flags gen ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: bsd new-file-info ( -- class ) bsd-file-info new ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: bsd stat>file-info ( stat -- file-info )
 | 
					
						
							|  |  |  |     [ call-next-method ] keep
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         [ stat-st_flags >>flags ] | 
					
						
							|  |  |  |         [ stat-st_gen >>gen ] | 
					
						
							| 
									
										
										
										
											2008-10-20 12:32:55 -04:00
										 |  |  |         [ | 
					
						
							|  |  |  |             stat-st_birthtimespec timespec>unix-time | 
					
						
							|  |  |  |             >>birth-time | 
					
						
							|  |  |  |         ] | 
					
						
							| 
									
										
										
										
											2008-10-07 00:02:06 -04:00
										 |  |  |     } cleave ;
 |