atoi | Convert a string into it decimal representation |
base64decode |
Decode a BASE64 file stream. |
base64encode |
Encode a BASE64 file stream. |
bsearch | Search a sorted array |
chdir | Change working directory |
date | Generate a string representation of a date value. |
define | Assign a value to a glossary variable. |
eval | Evaluate a string as an expression |
fclose | Close an opened file stream. |
feof | Test for an end-of-file condition. |
fflush | Write all buffered data from a file stream. |
fgetc | Read a character from a file stream. |
fgets | Read a string from a file stream. |
fopen | Open a file stream for reading or writing. |
format | Create a formatted string. |
fputc | Write a character to a file stream. |
fputs | Write a string to a file stream. |
free | Free allocated dynamic memory. |
fseek | Reposition a file stream. |
ftell | Get the position of a file stream. |
getcwd | Get current working directory |
getenv | Return the value of an environment variable. |
gets | Read a string from a file stream. |
glos_close | Close a glossary file. |
glos_find | Find a section in all opened glossary files. |
glos_open | Open a glossary file. |
glos_read | Read a glossary file. |
include | Evalute the contents of a file. |
index | Find a substring within a string. |
io | Copy an entire file stream. |
loadfileimage | Read an entire file into dynamic memory. |
malloc | Allocates dynamic memory. |
msg_close | Close a message catalogue. |
msg_get | Read message from a message catalogue. |
msg_open | Open a message catalogue. |
parse | Parse a string. |
putenv | Change or add an environment variable. |
qsort | Sort an array |
rand | Random number generator. |
read | Read a variable from a file stream. |
rewind | Reposition to the start of a file stream. |
sizeof | Obtain the size of an element. |
srand | Random number generator. |
strcmp_wild | Find a wild card within a string. |
strlen | Calculate the length of a string. |
strlower | Convert a string to upper and lower case. |
strstr_case | Search for a substring within a string. |
substr | Extract part of a string. |
system | Execute a shell command. |
time | Return system time in seconds. |
tmpfile | Create a temporary file |
tolower | Convert a string to lower case. |
toupper | Convert a string to upper case. |
trim | Strip leading and trailing space. |
unlink | Unlink (remove) a file. |
write | Write a list of variables into a file. |
Function Convert a string into it decimal representation
IS_INTEGER atoi ( IS_STRING number ); Remarks Converts the string representation of the decimal integer value, contain in argument number into it's binary integer value. This function is redundant. The same facility is available in the syntax by casting a string as an integer, i.e.
str = "34756834";Returns atoi returns the decimal equivalent of the number represented by the string argument. No return value is reserved to indicate an error. If a value cannot be represented, the return value is undefined.
num = (int)str;See also atoi(3).
Function Decode a BASE64 encoded file stream.
IS_NULL base64decode ( IS_FILE in, IS_FILE out ); Remarks Reads encode input stream and writes decoded output stream.
See also base64_encode().
Function Encode a file stream using BASE64.
IS_NULL base64encode ( IS_FILE in, IS_FILE out ); Remarks Reads decode input stream and writes encoded output stream.
See also base64_decode().
Function Search a sorted array
IS_NULL bsearch ( IS_ANY key, IS_POINTER base, IS_FUNCTION compar ); Remarks The bsearch() function searches an array which is pointed to by base, for a member that matches the object key.
The contents of the array should be in ascending sorted order according to the comparison function referenced by compar. The compar routine is expected to have two arguments which are of the same type as the key object and to an array member, in that order, and should return an integer less than, equal to, or greater than zero if the key object is found, respectively, to be less than, to match, or be greater than the array member.
/* Sort the debt array by name */Returns The bsearch() function returns a copy of a matching member of the array, or NULL if no match is found. If there are multiple elements that match the key, the first of any matching element returned.
#compare(a, b)
return(a[0] - b[0]);
))#main()
global compare();
debts = {
{"bill", 15.50},
{"bob", 34.65},
{"jack", 27.13}
};qsort(&debts, compare);
/* How much does Bob owe? */
who = {"bob", 0};
x = bsearch(who, &debts, compare);
write(stdout, x[1]);
))See also qsort()
Function Change working directory
IS_INTEGER chdir ( IS_STRING path ); Remarks chdir changes the current directory to that specified in path.
Returns On success, zero is returned. On error, -1 is returned, and the global variable errno is set appropriately.
See also chdir(2).
Function Generate a string representation of a date value.
IS_STRING date ( IS_STRING fmt, [ IS_INTEGER time ] ); Remarks The date function converts and formats the time argument, or if that is not supplied, the current time, into a string under control of the format string fmt. The string fmt is a character string that can contain two types of objects. These are plain characters, which are simply copied to the output string, and directives. Each directive is introduced by the percent character (%).
The directives are:
Returns date returns the string representation of the current date and time, or that of the argument time if it is supplied. The constant value NULL will be returned upon error.%a is replaced by the locale's abbreviated weekday name %A is replaced by the locale's full weekday name %b is replaced by the locale's abbreviated month name %B is replaced by the locale's full month name %c is replaced by the locale's appropriate date and time representation %d is replaced by the day of the month as a decimal number (01-31) %D is replaced by the date (%m/%d/%y). %h is replaced by the locale's abbreviated month name %H is replaced by the hour (24-hour clock) as a decimal number (00-23) %I is replaced by the hour (12-hour clock) as a decimal number (01-12) %j is replaced by the day of the year as a decimal number (001-366) %m is replaced by the month as a decimal number (01-12) %M is replaced by the minute as a decimal number (00-59) %n is replaced by a newline character. %p is replaced by the locale's equivalent of AM or PM. %r is replaced by the time in AM or PM notation according to the British or US conventions (%I:%M:%S\[AM|PM]). %S is replaced by the second as a decimal number (00-61) %t is replaced by a tab character. %T is replaced by the time (%H:%M:%S). %U is replaced by the week number of the year (Sunday as the first day of the week) as a decimal number (00-53). %w is replaced by the weekday as a decimal number [0(Sunday)-6]. %W is replaced by the week number of the year (Monday as the first day of the week) as a decimal number (00-53). %x is replaced by the locale's appropriate date representation. %X is replaced by the locale's appropriate time representation. %y is replaced by the year without a century as a decimal number (00-99). %Y is replaced by the year with a century as a decimal number. %Z is replaced by the timezone name, or by no characters if no timezone exists. %% is replaced by % See also date(1), strftime(3).
Function Assign a value to a glossary variable.
IS_NULL define ( IS_STRING name, IS_STRING value ); Remarks Assign the string value to the glossary variable name. Glossary variables are defined within glossary files with a #define declaration. Any variables defined in this way within glossary files which have been opened, may be assigned new values by this function.
Returns define does not return a value.
See also glos_open(), glos_close(), glosdump().
Function Evaluate a string as an expression
IS_ANY eval ( IS_STRING expr ); Remarks The string expr is evaluated as a normal PI language expression, and the result of that expression will be returned by the function, as in the following example;
#main()The result of the call to eval will be the result of the expression "x * 2", which will be decimal 4. The expression argument may be any valid PI expression, and so it may include function and subroutine calls.
x = 2
y = "x * 2";
x = eval(y);
write(stdout,x);
))Returns eval returns the result of the expression which was evaluated. The type of the return value will be the type of the expression.
See also
Function Close an opened file stream.
IS_INTEGER fclose ( IS_FILE fp ); Remarks Close the file stream fp which was previously opened by fopen.
Returns fclose returns zero upon success, or EOF upon failure.
See also fopen(), fopen(3).
Function Test for an end-of-file condition.
IS_INTEGER feof ( IS_FILE fp ); Remarks Test whether EOF on file stream fp has been encountered during an earlier call which would read from the file, such as fgets.
Returns feof returns non-zero if a prior file read encountered EOF, otherwise it will return zero.
See also feof(3).
Function Write all buffered data from a file stream.
IS_INTEGER fflush ( IS_FILE fp ); Remarks Causes any buffered data for the file stream fp to be written to that file. The file stream remains open.
Returns fflush returns zero upon success, or EOF upon failure, such as trying to flush a file stream which isn't open for writing.
See also fflush(3).
Function Read a character from a file stream.
IS_INTEGER fgetc ( IS_FILE fp ); Remarks Read the next character (a single byte) from the input file stream fp as an integer.
Returns fgetc returns EOF upon error, otherwise it returns zero or a positive integer being the decimal value of the character just read.
See also fgetc(3).
Function Read a string from a file stream.
IS_STRING fgets ( IS_FILE fp ); Remarks Read characters as a string from the input file stream fp, up to and including a newline character, or if there is no newline character, until EOF is encountered.
Returns fgets returns the string read from the input file stream, or NULL upon error or if EOF is encountered and no characters were read.
See also
Function Open a file stream for reading or writing.
IS_FILE fopen ( IS_STRING file, IS_STRING mode ); Remarks Opens the named file, and associates a file stream with it. The argument mode is a character string with one of the following values:
Returns fopen returns an opened file stream on success, or NULL if the named file cannot be opened.
- "r" open for reading
- "w" truncate or create for writing
- "a" append; open for writing at end of file, or create forwriting
- "r+" open for update (reading and writing)
- "w+" truncate or create for update
- "a+" append; open or create for update at end-of-file
See also fclose(), fopen(3).
Function Create a formatted string.
IS_STRING format ( IS_STRING fmt, [ ...] ); Remarks Convert, format, and print the remaining arguments under control of the string fmt. Fmt is a string that contains three types of objects: plain characters, which are simply duplicated in the result; escape sequences that represent non-graphic characters; and conversion specifications, each of which results in fetching of zero or more arguments. A runtime error message occurs if there are insufficient arguments for the format or if the format is exhausted while arguments remain.
Each conversion specification is introduced by the character "%". After the "%", the following appear in sequence:
This function is identical to the standard C libarary funtion printf, except that the result is passed back as a string. Reference should be made to other manuals for a full description of the format syntax.
- Zero or more flags, which modify the meaning of the conversion specification.
- An optional, decimal digit string specifying a minimum field width. If the converted value has fewer characters than the field width, it is padded on the left (or right, if the left-adjustment flag `-', described below, has been given) to the field width. The padding is with blanks unless the field width digit string starts with a zero, in which case the padding is with zeros.
- A precision that gives the minimum number of digits to appear for the d, i, o, u, x, or X conversions, the number of digits to appear after the decimal point for the e, E, and f conversions, the maximum number of significant digits for the g and G conversion, or the maximum number of characters to be printed from a string in s conversion. The precision takes the form of a period (``.'') followed by a decimal string; a null digit string is treated as zero. Padding specified by the precision overrides the padding specified by the field width.
- A character that indicates the type of conversion to be applied, and the type of argument expected. This may be;
conversion data type douxX IS_INTEGER feEgG IS_FLOAT c IS_INTEGER s IS_STRING Returns format returns a string containing the converted result, or NULL if an error occurs.
See also printf(3).
Function Write a character to a file stream.
IS_INTEGER fputc ( IS_INTEGER ch, IS_FILE fp ); Remarks Writes the integer ch to the output file stream fp as an character (single byte).
Returns fputc returns EOF upon error, otherwise it returns zero or a positive integer being the decimal value of the character just written.
See also fputc(3).
Function Write a string to a file stream.
IS_INTEGER fputs ( IS_STRING str, IS_FILE fp ); Remarks Writes the string str to the output file stream fp.
Returns fputs returns EOF upon error, which may occur when writing to a file stream which has not been opened for writing.
See also fputs(3).
Function Free allocated dynamic memory.
IS_NULL free ( IS_POINTER ptr ); Remarks frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc. Otherwise, or if free(ptr) has already been called before, undefined behaviour occurs. If ptr is NULL, no operation is performed.
Returns free does not return a value.
See also malloc().
Function Reposition a file stream.
IS_NULL fseek ( IS_FILE stream, IS_INTEGER whence ); Remarks The fseek function sets the file position indicator for the stream pointed to by stream. The new position, measured in bytes, is obtained by adding offset bytes to the SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. A successful call to the fseek function clears the end-of-file indicator for the stream.
The SEEK_SET, SEEK_CUR, or SEEK_END constants are defined in $Utools/Utools/include/pi.h.
Returns Upon successful completion, fseek returns 0. Otherwise, -1 is returned and the global variable errno is set to indicate the error.
See also ftell(), rewind(), fseek(3).
Function Get the position of a file stream.
IS_INTEGER ftell ( IS_FILE stream ); Remarks The ftell function obtains the current value of the file position indicator for the stream pointed to by stream.
Returns ftell returns the current file offset as the number of bytes from the start of the file.
See also fseek(), rewind(), ftell(3).
Function Get current working directory
IS_STRING getcwd ( ); Remarks The getcwd function returns the absolute path of the current working directory.
Returns NULL on failure (for example, if the current directory is not readable), with errno set accordingly.
See also chdir().
Function Return the value of an environment variable.
IS_STRING getenv ( IS_STRING name ); Remarks Search the environment for the string str of the form "str=[value]", and return a the value if such a string is present.
Returns getenv returns NULL if no matching environment variable is found, otherwise it returns the value of that variable.
See also putenv().
Function Read a string from a file stream.
IS_STRING fgets ( IS_FILE fp ); Remarks Read characters as a string from the input file stream fp, up to but not including a newline character, or if there is no newline character, until EOF is encountered. The newline character is discarded.
Returns gets returns the string read from the input file stream, or NULL upon error or if EOF is encountered and no characters were read.
See also
Function Close a glossary file.
IS_INTEGER glos_close ( IS_STRING name ); Remarks The glossary file name will be closed. This file will have previously been open with glos_open.
Returns glos_close always returns zero.
See also define(), glos_open(), glosdump().
Function Find a section in all opened glossary files.
IS_INTEGER glos_find ( IS_STRING section ); Remarks All currently opened glossary files will be searched for an matching named section. The file pointer for the matching file will be positioned at the start of the section so the next call to glos_read will read the first line of that glossary section
Returns glos_close returns non-zero if a matching entry is found, otherwise zero.
See also glos_open(), glos_read().
Function Open a glossary file.
IS_INTEGER glos_open ( IS_STRING name ); Remarks The glossary file name will be opened for reading. This makes any of the glossary entries within that file accessible for other glossary functions, such as glosdump and all the "Menu Library" functions.
Returns glos_open returns non-zero on success, or zero if it failed to open the glossary file.
See also define(), glos_close(), glosdump().
Function Read a glossary file.
IS_STRING glos_read ( IS_INTEGER mode ); Remarks Read the next line from the current file position of the current glossary file. The file position is located by glos_find. mode is ordinarly passed as zero, in which case this function will perform shell variable, in-line command and various other subsitutions on the string which is returned. The following defined constants may be OR'ed together and passed as mode to modify this action;
#define NO_EGLOS 0x0100 /* No embedded glossaries */Returns glos_read always returns a string.
#define NO_DSUBS 0x0200 /* No label substitution */
#define NO_UEFFS 0x0400 /* No visual effects */
#define NO_RULERS 0x0800 /* No uniplex rulers */
#define NO_SHELL 0x1000 /* No environment variable or command subst. */
#define NO_DIRECT 0x2000 /* No uniplex directives (dot commands) */See also glosdump(), glos_find(), glos_open().
Function Evalute the contents of a file.
IS_NULL include ( IS_STRING file ); Remarks The entire contents of the named file will be evaluated as PI source and executed. The file should include a relative or full path name.
Returns include does not return a value.
See also define().
Function Find a substring within a string.
IS_INTEGER index ( IS_STRING str, IS_STRING sub ); Remarks index returns the offset of substring sub within string str. The offset is zero based. i.e. If the string starts with the substring, this function will return zero.
Returns Zero or greater if the substring is found, otherwise -1.
See also strstr_case().
Function Copy an entire file stream.
IS_INTEGER io ( IS_FILE fpi, IS_FILE fpo, IS_INTEGER size ); Remarks io reads from file stream fpi which was opened for reading to file stream fpo which has been opened for writing. If size is greater than 1, the data will be copied in blocks of size bytes, otherwise the file is copied one byte at a time.
Returns size.
See also substr().
Function Read an entire file into dynamic memory.
IS_POINTER loadfileimage ( IS_STRING file ); Remarks The named file is opened for reading and the entire contents of the file will be read into a allocated block of memory. After reading, the file will be closed. The allocated memory will need to be freed when it is no longer required.
Returns A pointer to the allocated memory block, otherwise NULL..
See also free(), malloc().
Function Allocates dynamic memory.
IS_POINTER malloc ( IS_INTEGER size ); Remarks Allocates memory for an array of size bytes each and returns a pointer to the allocated memory. The memory is set to zero.
Returns The value returned is a pointer to the allocated memory, which is suitably aligned for any kind of variable, or NULL if the request fails.
See also free().
Function Close a message catalogue.
IS_INTEGER msg_close ( IS_INTEGER cat ); Remarks Close the message catalogue identified by cat which was previously opened by msg_open.
Returns msg_close returns zero on success, or non-zero if the message catalogue is not valid.
See also msg_open(), msg_get().
Function Read message from a message catalogue.
IS_STRING msg_get ( IS_INTEGER cat, IS_INTEGER msg ); Remarks Read message number msg from catalogue cat which was previously opened by msg_open.
Messages are maintained in plain ASCII files in numerical order. Each line of the file will contain a decimal number, being the message number, followed by one or more spaces, and then the message.
Messages may contain environment variable notation or in-line commands using Unix shell notation. Any substitution will be performed of the message before it is returned.
Returns msg_get returns a string containing the nominated message, or NULL if the catalogue ID or message number are invalid.
See also msg_open(), msg_close().
Function Open a message catalogue.
IS_INTEGER msg_open ( IS_STRING name ); Remarks Open the message catalogue name for further reading by msg_get.
Returns msg_open returns a negative integer if the message catalogue cannot be opened. Otherwise it returns zero or a positive integer which is used as a catalogue identifier in future calls to msg_get and msg_close.
See also msg_close(), msg_get().
Function Parse a string.
{ IS_STRING, [ ... ] } parse ( IS_STRING expr[, IS_INTEGER delim ] ); Remarks The string expr parsed as a space or tab separated string of words, if delim is not specified, and all leading and trailing white space characters are discarded and the function returns an array where each element conatins individual words parsed from the string. Or if delim is specified, the string will be broken un into an array and any matching delim characters will be discarded.
The following example demonstrates this;
#main(argc,argv)
local str;
while ((str = gets(stdin)) != NULL) {
str = parse(str);
write(stdout,str);
}
))
This program will read lines read from standard input and write an array containing the individual parts to standard output. Any strings contained within double quotes are retained intact, but the backslash character may be used to escape a double quote character embedded within a string.Returns parse returns an array sized according to the number of words found in the string expression, or NULL is returned if the string expression is empty.
See also
Function Change or add an environment variable.
IS_INTEGER putenv ( IS_STRING string ); Remarks The putenv() function adds or changes the value of environment variables. The argument string is of the form "name=value". If name does not already exist in the environment, then string is added to the environment. If name does exist, then the value of name in the environment is changed to value. The string pointed to by string becomes part of the environment, so altering the string changes the environment.
Returns The putenv function returns zero on success, or -1 if an error occurs.
See also getenv();
Function Sort an array.
IS_NULL qsort ( IS_POINTER base, IS_FUNCTION compar ); Remarks The qsort function sorts an array The base argument points to the array.
The contents of the array are sorted in ascending order according to a comparison function pointed to by compar, which is called with two arguments that point to the objects being compared.
The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. If two members compare as equal, their order in the sorted array is undefined.
#compare(a, b)Returns The bsearch() does not return a value.
return(a - b);
))#main()
global compare();
base = {"the", "quick", "brown", "fox"};qsort(&base, compare);
write(stderr, base);
))See also bsearch()
Function Random number generator.
IS_INTEGER rand ( ); Remarks The rand() function returns a positive pseudo-random integer value. The pseudo random number generator must be seeded first using srand().
Returns The rand() function returns a value between 0 and RAND_MAX.
See also srand().
Function Read a variable from a file stream.
IS_ANY read ( IS_FILE fp ); Remarks Read a variable from the file stream fp. The variable will have been previously written by write. Variables stored in this way are written in an ASCII form. If the next variable to be read from the file stream is an array, the entire array will be returned.
Returns read returns the next variable from the file input stream fp. The type of the return value will be the type of the variable returned. The constant value NULL will be returned upon error or if EOF is encountered.
See also write().
Function Reposition to the start of a file stream.
IS_NULL rewind ( IS_FILE fp ); Remarks Reposition the file pointer fp at the start of the file stream.
Returns rewind does not return a result.
See also rewind(3).
Function Obtain the size of an element.
IS_INTEGER sizeof ( IS_ANY elem ); Remarks Identifies the type of the element elem. The return value may be tested against the following constants which are defined in the header file pi.h.
These are all negative, except IS_NULL which is zero. A positive result indicates that the element is an array, and the integer value indicates how many elements are in the array.
- IS_INTEGER
- IS_FLOAT
- IS_STRING
- IS_FUNCTION
- IS_FILE
- IS_POINTER
- IS_ISAM
Returns sizeof returns an integer corresponding to the type of the argument, or NULL if there are insufficent or too many arguments.
See also
Function Random number generator.
IS_NULL srand ( IS_INTEGER seed ); Remarks The srand() function sets its argument as the seed for a new sequence of pseudo-random integers to be returned by rand(). These sequences are repeatable by calling srand() with the same seed value.
If no seed value is provided, the rand() function is automatically seeded with a value of 1.
Returns The rand() function does not return any value.
See also rand().
Function Find a wild card within a string.
IS_INTEGER strcmp_wild ( IS_STRING str, IS_STRING wild, IS_INTEGER casen ); Remarks Search for the wild card string wild within str. This search may be either case sensitive (casen=1), or case insensitive (casen=0). The characters '*' and '?' are recognised by the function.
Returns strcmp_wild returns zero if a matching substring is found, or non-zero if no matching substring is found.
See also
Function Calculate the length of a string.
IS_INTEGER strlen ( IS_STRING s ); Remarks The string s is evaluated and it's length is returned.
Returns strlen returns the length of the string in bytes.
See also strlen(3).
Function Convert a string to upper and lower case.
IS_STRING strlower ( IS_STRING s ); Remarks String s is converted to lower and upper case combination. All leading characters following spaces or non-alpha characters are converted to upper case, and all others are converted to lower case.
Returns strlower returns the converted string.
See also tolower(), toupper().
Function Search for a substring within a string.
IS_INTEGER index ( IS_STRING str, IS_STRING sub, IS_INTEGER casen ); Remarks strstr_case returns the offset of substring sub within string str. The offset is zero based. i.e. If the string starts with the substring, this function will return zero. If casen is zero, the search is case insensitive, otherwise case is significant.
Returns Zero or greater if the substring is found, otherwise -1.
See also index().
Function Extract part of a string.
IS_STRING substr ( IS_STRING str, IS_INTEGER pos, IS_INTEGER len ); Remarks Extract a sub-string from str, starting at position pos, and extending for length len. The position starts at index zero, so postion 2 would be the third character in str. If len is zero, the remaining string will be returned, otherwise this specifies the number of character positions to be returned within the sub-string.
Returns substr returns the sub-string nominated by the arguments.
See also
Function Execute a shell command.
IS_INTEGER system ( IS_STRING command ); Remarks The command is passed to a shell for execution as if it had been typed at the terminal command line.
Returns system returns the exit status of the command, or -1 in case of an error.
See also system(3).
Function Return system time in seconds.
IS_INTEGER time ( [ IS_STRING date ] ); Remarks If a date is given, it will be parsed for a date in the form;
DD/MM/YY HH:MM:SSand the function will return the system time (in seconds since 1/1/70 midnight GMT) represented by this date. If no argument is given, the function will return the current system time.Returns time returns the current, or nominated system time in seconds since 1/1/1970 midnight GMT.
See also
Function Create a temporary file
IS_FILE tmpfile ( ); Remarks The tmpfile() function generates a unique temporary filename. The temporary file is then opened in binary read/write (w+b) mode. The file will be automatically deleted when it is closed or the program terminates.
Returns The tmpfile() function returns a stream descriptor, or NULL if a unique filename cannot be generated or the unique file cannot be opened.
See also fopen().
Function Convert a string to lower case.
IS_STRING tolower ( IS_STRING s ); Remarks String s is converted to lower case.
Returns tolower returns the converted string.
See also strlower(), toupper().
Function Convert a string to upper case.
IS_STRING toupper ( IS_STRING s ); Remarks String s is converted to upper case.
Returns toupper returns the converted string.
See also strlower(), tolower().
Function Strip leading and trailing space.
IS_STRING trim ( IS_STRING s ); Remarks All leading and trailing space characters are removed from string s.
Returns trim returns the converted string.
See also
Function Unlink (remove) a file.
IS_INTEGER unlink ( IS_STRING name ); Remarks Unlink the named file, name. If the files link count is zero, the file will be removed.
Returns unlink returns zero unpon success, otherwise it returns -1 and errno is set to indicate the error.
See also unlink(2).
Function Write a list of variables into a file.
IS_NULL write ( IS_FILE fp , IS_ANY [ ... ] ); Remarks Write one or more variables to the file stream fp. The variables may be later read back by read. Variables are written in an ASCII form. If any variable to be written to the file stream is an array, the entire contents of the array will be written.
Returns write does not return any result.
See also read().