2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								USING:  generic  help.markup  help.syntax  kernel  math  memory 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-27 17:31:13 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								namespaces sequences kernel.private strings ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								IN:  system 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ARTICLE: "os"  "System interface" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Operating system detection:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection os }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection unix? }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection macosx? }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection solaris? }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection windows? }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection winnt? }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection win32? }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection win64? }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection wince? }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Processor detection:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection cpu }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Reading environment variables:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection os-env }
							 
						 
					
						
							
								
									
										
										
										
											2007-11-16 21:07:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsection os-envs }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Getting the path to the Factor VM and image:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection vm }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection image }
							 
						 
					
						
							
								
									
										
										
										
											2007-11-16 21:07:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								"Getting the current time:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection millis }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Exiting the Factor VM:" 
							 
						 
					
						
							
								
									
										
										
										
											2007-11-16 21:07:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsection exit }
							 
						 
					
						
							
								
									
										
										
										
											2008-02-27 17:31:13 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $see-also "io.files"  "io.mmap"  "io.monitors"  "network-streams"  "io.launcher"  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ABOUT: "os" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  cpu 
							 
						 
					
						
							
								
									
										
										
										
											2007-11-16 21:07:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "cpu"  string  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Outputs a string descriptor of the current CPU architecture. Currently, this set of descriptors is:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $code "x86.32"  "x86.64"  "ppc"  "arm"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  os 
							 
						 
					
						
							
								
									
										
										
										
											2007-11-16 21:07:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "os"  string  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Outputs a string descriptor of the current operating system family. Currently, this set of descriptors is:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $code
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        "freebsd" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        "linux" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        "macosx" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        "openbsd" 
							 
						 
					
						
							
								
									
										
										
										
											2008-01-29 19:02:42 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        "netbsd" 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        "solaris" 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-05 19:48:38 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        "wince" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        "winnt" 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  embedded? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if this Factor instance is embedded in another application."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  windows? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if Factor is running on Windows."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  winnt? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if Factor is running on Windows XP or Vista."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  wince? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if Factor is running on Windows CE."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  macosx? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if Factor is running on Mac OS X."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  linux? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if Factor is running on Linux."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  solaris? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if Factor is running on Solaris."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  bsd? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if Factor is running on FreeBSD/OpenBSD/NetBSD."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  exit  (  n  --  )
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "n"  "an integer exit code"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Exits the Factor process."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  millis  (  --  n  )
 
							 
						 
					
						
							
								
									
										
										
										
											2007-11-16 21:07:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "n"  integer  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the number of milliseconds ellapsed since midnight January 1, 1970."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes "This is a low-level word. The "  { $vocab-link "calendar"  } " vocabulary provides features for date/time arithmetic and formatting."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  os-env  (  key  --  value  )
 
							 
						 
					
						
							
								
									
										
										
										
											2007-11-16 21:07:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "key"  string  } { "value"  string  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Looks up the value of a shell environment variable."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "This is an operating system-specific feature. On Unix, you can do:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $unchecked-example "\"USER\" os-env print"  "jane"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-11-16 21:07:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $errors "Windows CE has no concept of environment variables, so this word throws an error there."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  os-envs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "assoc"  "an association mapping strings to strings"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the current set of environment variables."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Names and values of environment variables are operating system-specific." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $errors "Windows CE has no concept of environment variables, so this word throws an error there."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-03-12 02:54:29 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  set-os-envs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "assoc"  "an association mapping strings to strings"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Replaces the current set of environment variables."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Names and values of environment variables are operating system-specific." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $errors "Windows CE has no concept of environment variables, so this word throws an error there."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ os-env os-envs set-os-envs } related-words
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  win32? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if Factor is running on 32-bit Windows."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  win64? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if Factor is running on 64-bit Windows."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  image 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "path"  "a pathname string"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the pathname of the currently running Factor image."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  vm 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "path"  "a pathname string"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the pathname of the currently running Factor VM."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  unix? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "?"  "a boolean"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if Factor is running on a Unix-like system. While this is a rather vague notion, one can use it to make certain assumptions about system calls and file structure which are not valid on Windows."  } ;