test

test(cmd, file1 [, file2] ) â obj Instance Public methods Uses the integer cmd to perform various tests on file1 (first table below) or on file1 and file2 (second table). File tests on a single file: Cmd Returns Meaning "A" | Time | Last access time for file1 "b" | boolean | True if file1 is a block device "c" | boolean | True if file1 is a character device "C" | Time | Last change time for file1 "d" | boolean | True if file1 exists and is a directory "e" | boolea

system

system([env,] command... [,options]) â true, false or nil Instance Public methods Executes command⦠in a subshell. command⦠is one of following forms. commandline : command line string which is passed to the standard shell cmdname, arg1, ... : command name and one or more arguments (no shell) [cmdname, argv0], arg1, ... : command name, argv[0] and zero or more arguments (no shell) system returns true if the command gives zero exit status, false for no

syscall

syscall(num [, args...]) â integer Instance Public methods Calls the operating system function identified by _num_ and returns the result of the function or raises SystemCallError if it failed. Arguments for the function can follow _num_. They must be either +String+ objects or +Integer+ objects. A +String+ object is passed as a pointer to the byte sequence. An +Integer+ object is passed as an integer whose bit size is same as a pointer. Up to nine parameters may be passed (14

sub

sub(pattern, replacement) â $_sub(pattern) { block } â $_ Instance Public methods Equivalent to $_.sub(args), except that $_ will be updated if substitution occurs. Available only when -p/-n command line option specified.

srand

srand(number = Random.new_seed) â old_seed Instance Public methods Seeds the system pseudo-random number generator, Random::DEFAULT, with number. The previous seed value is returned. If number is omitted, seeds the generator using a source of entropy provided by the operating system, if available (/dev/urandom on Unix systems or the RSA cryptographic provider on Windows), which is then combined with the time, the process id, and a sequence number. srand may be used to ensure repe

sprintf

sprintf(format_string [, arguments...] ) â string Instance Public methods Returns the string resulting from applying format_string to any additional arguments. Within the format string, any characters other than format sequences are copied to the result. The syntax of a format sequence is follows. %[flags][width][.precision]type A format sequence consists of a percent sign, followed by optional flags, width, and precision indicators, then terminated with a field type character.

spawn

spawn([env,] command... [,options]) â pidProcess.spawn([env,] command... [,options]) â pid Instance Public methods spawn executes specified command and return its pid. This method doesn't wait for end of the command. The parent process should use Process.wait to collect the termination status of its child or use Process.detach to register disinterest in their status; otherwise, the operating system may accumulate zombie processes. spawn has bunch of options to specify proc

sleep

sleep([duration]) â fixnum Instance Public methods Suspends the current thread for duration seconds (which may be any number, including a Float with fractional seconds). Returns the actual number of seconds slept (rounded), which may be less than that asked for if another thread calls Thread#run. Called without an argument, sleep() will sleep forever. Time.new #=> 2008-03-08 19:56:19 +0900 sleep 1.2 #=> 1 Time.new #=> 2008-03-08 19:56:20 +0900 sleep 1.9 #=>

set_trace_func

set_trace_func(proc) â procset_trace_func(nil) â nil Instance Public methods Establishes proc as the handler for tracing, or disables tracing if the parameter is nil. proc takes up to six parameters: an event name a filename a line number an object id a binding the name of a class proc is invoked whenever an event occurs. Events are: c-call call a C-language routine c-return return from a C-language routine call call a Ruby method class start a

select

IO.select(read_array[, write_array[, error_array[, timeout]]]) â array or nil Instance Public methods Calls select(2) system call. It monitors given arrays of IO objects, waits one or more of IO objects ready for reading, are ready for writing, and have pending exceptions respectably, and returns an array that contains arrays of those IO objects. It will return nil if optional timeout value is given and no IO object is ready in timeout seconds. Parameters read_array an array