02.05.2013 Views

Description - Mks.com

Description - Mks.com

Description - Mks.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

putenv() alter value of environment variable<br />

read(indexable_object) return next token from indexable_object<br />

replace(str,old,new) return str with old replaced by new<br />

rindex(str,expr) return index of last expr in str<br />

strerror() return string corresponding to errno<br />

substr(expr,pos) return substring of expr starting at pos<br />

substr(expr,pos,len) return length len substring of expr starting at pos<br />

tail(indexable_object) return unread portion of indexable_object<br />

tempfile([dir_str,]<br />

pre_str)<br />

temporary file name<br />

tolower(expr) return expr in lowercase<br />

toupper(expr) return expr in uppercase<br />

Table 3: Summary of cc Functions<br />

access(filename, [mode])<br />

returns true if the access mode of filename is the same as the supplied mode. The mode<br />

should be passed as a string <strong>com</strong>posed of the characters r, w, x, or f (for read, write,<br />

execute, or file existence). If no mode is supplied, f is assumed.<br />

access("temp.af9","f") -- checks if temp.af9 exists<br />

access("temp.af9","rw") -- checks for read/write<br />

permission on temp.af9<br />

If the base operating system allows, mode can be passed as a number. This is non-portable, so<br />

you should use a string representation.<br />

cd(pathname)<br />

changes the current directory to the value of pathname.<br />

cinclude(filename)<br />

includes the specified file. No path search is performed. If filename is not an absolute path<br />

name, the current directory is searched. If the file does not exist, this function returns 0;<br />

otherwise, it returns 1.<br />

exec(expression {, expression})<br />

is similar to the exec statement. The value of an exec expression is the exit status of the<br />

last <strong>com</strong>mand executed. This is an integer.<br />

filepath(expression)<br />

returns a vector whose <strong>com</strong>ponents are the strings corresponding to the path name<br />

<strong>com</strong>ponents of the string expression. The built-in variable DIRSEPSTR is used to determine<br />

320 of 457

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!