ajsys.c
Datatypes: none
System utility functions
Sections: Argument list manipulation functions System cast functions System functions for files Wrappers to commands Wrappers to C functions executing commands executing programs Miscellaneous system functions piped commands exit
Function for manipulating argument list.
Functions: ajSysArglistBuildC ajSysArglistBuildS ajSysArglistFree
Generates a program name and argument list from a command line string.
Synopsis
Prototype
AjBool ajSysArglistBuildC (
const char* cmdlinetxt,
char** Pname,
char*** PParglist
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | Command line. |
char** | Pname | Output | Program name. |
char*** | PParglist | Output | Argument list. |
AjBool | | RETURN | ajTrue on success. |
Input
cmdlinetxt: | (Input) | Command line. |
Output
Pname: | (Output) | Program name. |
PParglist: | (Output) | Argument list. |
Returns
AjBool: | ajTrue on success. |
Description
Generates a program name and argument list from a command line string.
See Also
See other functions in this section
Availability
In release 6.4.0
Generates a program name and argument list from a command line string.
Synopsis
Prototype
AjBool ajSysArglistBuildS (
const AjPStr cmdline,
char** Pname,
char*** PParglist
);
Type | Name | Read/Write | Description |
const AjPStr | cmdline | Input | Command line. |
char** | Pname | Output | Program name. |
char*** | PParglist | Output | Argument list. |
AjBool | | RETURN | ajTrue on success. |
Input
cmdline: | (Input) | Command line. |
Output
Pname: | (Output) | Program name. |
PParglist: | (Output) | Argument list. |
Returns
AjBool: | ajTrue on success. |
Description
Generates a program name and argument list from a command line string.
See Also
See other functions in this section
Availability
In release 6.4.0
Free memory in an argument list allocated by ajSysArgList
Synopsis
Prototype
void ajSysArglistFree (
char*** PParglist
);
Type | Name | Read/Write | Description |
char*** | PParglist | Output | Argument list. |
void | | RETURN | |
Output
PParglist: | (Output) | Argument list. |
Returns
Description
Free memory in an argument list allocated by ajSysArgList
See Also
See other functions in this section
Availability
In release 6.4.0
Function for casting one datatype to another.
Functions: ajSysCastItoc ajSysCastItouc
Convert Int to Char
Needed for very fussy compilers i.e. Digital C
Synopsis
Prototype
char ajSysCastItoc (
ajint v
);
Type | Name | Read/Write | Description |
ajint | v | Input | integer |
char | | RETURN | Character cast |
Input
Returns
Description
Convert Int to Char
Needed for very fussy compilers i.e. Digital C
See Also
See other functions in this section
Availability
In release 6.4.0
Convert Int to Unsigned Char
Needed for very fussy compilers i.e. Digital C
Synopsis
Prototype
unsigned char ajSysCastItouc (
ajint v
);
Type | Name | Read/Write | Description |
ajint | v | Input | integer |
unsigned char | | RETURN | Unsigned character cast |
Input
Returns
unsigned char: | Unsigned character cast |
Description
Convert Int to Unsigned Char
Needed for very fussy compilers i.e. Digital C
See Also
See other functions in this section
Availability
In release 6.4.0
System functions for files.
Functions: ajSysFileRmrfC ajSysFileUnlinkC ajSysFileUnlinkS ajSysFileWhich ajSysFileWhichEnv ajSysGetHomedir ajSysGetHomedirFromName
Forcibly delete a directory tree
Synopsis
Prototype
AjBool ajSysFileRmrfC (
const char* path
);
Type | Name | Read/Write | Description |
const char* | path | Input | Directory path |
AjBool | | RETURN | true if deleted false otherwise |
Input
path: | (Input) | Directory path |
Returns
AjBool: | true if deleted false otherwise |
Description
Forcibly delete a directory tree
See Also
See other functions in this section
Availability
In release 6.4.0
Deletes a file or link
Synopsis
Prototype
AjBool ajSysFileUnlinkC (
const char* filename
);
Type | Name | Read/Write | Description |
const char* | filename | Input | Filename in AjStr. |
AjBool | | RETURN | true if deleted false otherwise |
Input
filename: | (Input) | Filename in AjStr. |
Returns
AjBool: | true if deleted false otherwise |
Description
Deletes a file or link
See Also
See other functions in this section
Availability
In release 6.4.0
Deletes a file or link
Synopsis
Prototype
AjBool ajSysFileUnlinkS (
const AjPStr filename
);
Type | Name | Read/Write | Description |
const AjPStr | filename | Input | Filename in AjStr. |
AjBool | | RETURN | true if deleted false otherwise |
Input
filename: | (Input) | Filename in AjStr. |
Returns
AjBool: | true if deleted false otherwise |
Description
Deletes a file or link
See Also
See other functions in this section
Availability
In release 6.4.0
Gets the Basename of a file then searches $PATH sequentially until it
finds a user-EXECUTABLE file of the same name.
Synopsis
Prototype
AjBool ajSysFileWhich (
AjPStr* Pfilename
);
Type | Name | Read/Write | Description |
AjPStr* | Pfilename | Modify | Filename in AjStr, replaced by full pathname |
AjBool | | RETURN | True if executable found, false otherwise |
Input & Output
Pfilename: | (Modify) | Filename in AjStr, replaced by full pathname |
Returns
AjBool: | True if executable found, false otherwise |
Description
Gets the Basename of a file then searches $PATH sequentially until it
finds a user-EXECUTABLE file of the same name.
See Also
See other functions in this section
Availability
In release 6.4.0
Gets the Basename of a file then searches $PATH sequentially until it
finds a user-EXECUTABLE file of the same name. Reentrant.
Synopsis
Prototype
AjBool ajSysFileWhichEnv (
AjPStr* Pfilename,
char* const[] env
);
Type | Name | Read/Write | Description |
AjPStr* | Pfilename | Modify | Filename in AjStr, replaced by full pathname |
char* const[] | env | Input | Environment |
AjBool | | RETURN | True if executable found, false otherwise |
Input
Input & Output
Pfilename: | (Modify) | Filename in AjStr, replaced by full pathname |
Returns
AjBool: | True if executable found, false otherwise |
Description
Gets the Basename of a file then searches $PATH sequentially until it
finds a user-EXECUTABLE file of the same name. Reentrant.
See Also
See other functions in this section
Availability
In release 6.4.0
Get the home directory of the current user
Synopsis
Prototype
char* ajSysGetHomedir (
void
);
Type | Name | Read/Write | Description |
char* | | RETURN | Home directory or NULL |
Returns
char*: | Home directory or NULL |
Description
Get the home directory of the current user
See Also
See other functions in this section
Availability
In release 6.4.0
Get a home directory location from a username
Synopsis
Prototype
char* ajSysGetHomedirFromName (
const char* username
);
Type | Name | Read/Write | Description |
const char* | username | Input | Username |
char* | | RETURN | Home directory or NULL |
Input
Returns
char*: | Home directory or NULL |
Description
Get a home directory location from a username
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for invoking commands
Functions: ajSysCommandCopyC ajSysCommandCopyS ajSysCommandMakedirC ajSysCommandMakedirS ajSysCommandRemoveC ajSysCommandRemoveS ajSysCommandRemovedirC ajSysCommandRemovedirS ajSysCommandRenameC ajSysCommandRenameS
Copy a file
Synopsis
Prototype
AjBool ajSysCommandCopyC (
const char* name,
const char* name2
);
Type | Name | Read/Write | Description |
const char* | name | Input | Source filename |
const char* | name2 | Input | Target filename |
AjBool | | RETURN | True on success |
Input
name: | (Input) | Source filename |
name2: | (Input) | Target filename |
Returns
Description
Copy a file
See Also
See other functions in this section
Availability
In release 6.4.0
Copy a file
Synopsis
Prototype
AjBool ajSysCommandCopyS (
const AjPStr strname,
const AjPStr strname2
);
Type | Name | Read/Write | Description |
const AjPStr | strname | Input | Source filename |
const AjPStr | strname2 | Input | Target filename |
AjBool | | RETURN | True on success |
Input
strname: | (Input) | Source filename |
strname2: | (Input) | Target filename |
Returns
Description
Copy a file
See Also
See other functions in this section
Availability
In release 6.4.0
Delete a file
Synopsis
Prototype
AjBool ajSysCommandMakedirC (
const char* name
);
Type | Name | Read/Write | Description |
const char* | name | Input | Directory |
AjBool | | RETURN | True on success |
Input
Returns
Description
Delete a file
See Also
See other functions in this section
Availability
In release 6.4.0
Delete a file
Synopsis
Prototype
AjBool ajSysCommandMakedirS (
const AjPStr strname
);
Type | Name | Read/Write | Description |
const AjPStr | strname | Input | Directory |
AjBool | | RETURN | True on success |
Input
Returns
Description
Delete a file
See Also
See other functions in this section
Availability
In release 6.4.0
Delete a file
Synopsis
Prototype
AjBool ajSysCommandRemoveC (
const char* name
);
Type | Name | Read/Write | Description |
const char* | name | Input | Filename |
AjBool | | RETURN | True on success |
Input
Returns
Description
Delete a file
See Also
See other functions in this section
Availability
In release 6.4.0
Delete a file
Synopsis
Prototype
AjBool ajSysCommandRemoveS (
const AjPStr strname
);
Type | Name | Read/Write | Description |
const AjPStr | strname | Input | Filename |
AjBool | | RETURN | True on success |
Input
Returns
Description
Delete a file
See Also
See other functions in this section
Availability
In release 6.4.0
Delete a file
Synopsis
Prototype
AjBool ajSysCommandRemovedirC (
const char* name
);
Type | Name | Read/Write | Description |
const char* | name | Input | Directory |
AjBool | | RETURN | True on success |
Input
Returns
Description
Delete a file
See Also
See other functions in this section
Availability
In release 6.4.0
Delete a file
Synopsis
Prototype
AjBool ajSysCommandRemovedirS (
const AjPStr strname
);
Type | Name | Read/Write | Description |
const AjPStr | strname | Input | Directory |
AjBool | | RETURN | True on success |
Input
Returns
Description
Delete a file
See Also
See other functions in this section
Availability
In release 6.4.0
Rename a file
Synopsis
Prototype
AjBool ajSysCommandRenameC (
const char* name,
const char* name2
);
Type | Name | Read/Write | Description |
const char* | name | Input | Source filename |
const char* | name2 | Input | Target filename |
AjBool | | RETURN | True on success |
Input
name: | (Input) | Source filename |
name2: | (Input) | Target filename |
Returns
Description
Rename a file
See Also
See other functions in this section
Availability
In release 6.4.0
Rename a file
Synopsis
Prototype
AjBool ajSysCommandRenameS (
const AjPStr strname,
const AjPStr strname2
);
Type | Name | Read/Write | Description |
const AjPStr | strname | Input | Source filename |
const AjPStr | strname2 | Input | Target filename |
AjBool | | RETURN | True on success |
Input
strname: | (Input) | Source filename |
strname2: | (Input) | Target filename |
Returns
Description
Rename a file
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for calling or substituting C-functions.
Functions: ajSysFuncFdopen ajSysFuncFgets ajSysFuncFopen ajSysFuncSocket ajSysFuncStrdup ajSysFuncStrtok ajSysFuncStrtokR
Place non-ANSI fdopen here
Synopsis
Prototype
FILE* ajSysFuncFdopen (
ajint filedes,
const char* mode
);
Type | Name | Read/Write | Description |
ajint | filedes | Input | file descriptor |
const char* | mode | Input | file mode |
FILE* | | RETURN | file pointer |
Input
filedes: | (Input) | file descriptor |
mode: | (Input) | file mode |
Returns
Description
Place non-ANSI fdopen here
See Also
See other functions in this section
Availability
In release 6.4.0
An fgets replacement that will cope with Mac OSX <CR> files
Synopsis
Prototype
char* ajSysFuncFgets (
char* buf,
int size,
FILE* fp
);
Type | Name | Read/Write | Description |
char* | buf | Output | buffer |
int | size | Input | maximum length to read |
FILE* | fp | Modify | stream |
char* | | RETURN | buf or NULL |
Input
size: | (Input) | maximum length to read |
Output
Input & Output
Returns
Description
An fgets replacement that will cope with Mac OSX <CR> files
See Also
See other functions in this section
Availability
In release 6.4.0
An fopen replacement to cope with cygwin and windows
Synopsis
Prototype
FILE* ajSysFuncFopen (
const char* name,
const char* flags
);
Type | Name | Read/Write | Description |
const char* | name | Input | file to open |
const char* | flags | Input | r/w/a flags |
FILE* | | RETURN | file or NULL |
Input
name: | (Input) | file to open |
flags: | (Input) | r/w/a flags |
Returns
Description
An fopen replacement to cope with cygwin and windows
See Also
See other functions in this section
Availability
In release 6.4.0
Socket function coping with UNIX and WIN32
Synopsis
Prototype
SOCKRET ajSysFuncSocket (
int domain,
int type,
int protocol
);
Type | Name | Read/Write | Description |
int | domain | Input | Domain |
int | type | Input | Type |
int | protocol | Input | Protocol |
SOCKRET | | RETURN | Universal (UNIX/WIN32) socket value |
Input
domain: | (Input) | Domain |
type: | (Input) | Type |
protocol: | (Input) | Protocol |
Returns
SOCKRET: | Universal (UNIX/WIN32) socket value |
Description
Socket function coping with UNIX and WIN32
See Also
See other functions in this section
Availability
In release 6.4.0
Duplicate BSD strdup function for very strict ANSI compilers
Synopsis
Prototype
char* ajSysFuncStrdup (
const char* dupstr
);
Type | Name | Read/Write | Description |
const char* | dupstr | Input | string to duplicate |
char* | | RETURN | Text string as for strdup |
Input
dupstr: | (Input) | string to duplicate |
Returns
char*: | Text string as for strdup |
Description
Duplicate BSD strdup function for very strict ANSI compilers
See Also
See other functions in this section
Availability
In release 6.4.0
strtok that doesn't corrupt the source string
Synopsis
Prototype
char* ajSysFuncStrtok (
const char* srcstr,
const char* delimstr
);
Type | Name | Read/Write | Description |
const char* | srcstr | Input | source string |
const char* | delimstr | Input | delimiter string |
char* | | RETURN | pointer or NULL when nothing is found |
Input
srcstr: | (Input) | source string |
delimstr: | (Input) | delimiter string |
Returns
char*: | pointer or NULL when nothing is found |
Description
strtok that doesn't corrupt the source string
See Also
See other functions in this section
Availability
In release 6.4.0
Reentrant strtok that doesn't corrupt the source string.
This function uses a string buffer provided by the caller.
Synopsis
Prototype
char* ajSysFuncStrtokR (
const char* srcstr,
const char* delimstr,
const char** ptrptr,
AjPStr* buf
);
Type | Name | Read/Write | Description |
const char* | srcstr | Modify | source string |
const char* | delimstr | Input | delimiter string |
const char** | ptrptr | Modify | ptr save |
AjPStr* | buf | Output | result buffer |
char* | | RETURN | pointer or NULL |
Input
delimstr: | (Input) | delimiter string |
Output
buf: | (Output) | result buffer |
Input & Output
srcstr: | (Modify) | source string |
ptrptr: | (Modify) | ptr save |
Returns
Description
Reentrant strtok that doesn't corrupt the source string.
This function uses a string buffer provided by the caller.
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for executing commands
Functions: ajSysExecC ajSysExecS ajSysExecEnvC ajSysExecEnvS ajSysExecLocaleC ajSysExecLocaleS ajSysExecOutnameC ajSysExecOutnameS ajSysExecOutnameAppendC ajSysExecOutnameAppendS ajSysExecOutnameErrC ajSysExecOutnameErrS ajSysExecOutnameErrAppendC ajSysExecOutnameErrAppendS ajSysExecPathC ajSysExecPathS ajSysExecRedirectC
Exec a command line as if from the C shell
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecC (
const char* cmdlinetxt
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | The command line |
ajint | | RETURN | Exit status |
Input
cmdlinetxt: | (Input) | The command line |
Returns
Description
Exec a command line as if from the C shell
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecS (
const AjPStr cmdline
);
Type | Name | Read/Write | Description |
const AjPStr | cmdline | Input | The command line |
ajint | | RETURN | Exit status |
Input
cmdline: | (Input) | The command line |
Returns
Description
Exec a command line as if from the C shell
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell
This routine must be passed the environment received from
main(ajint argc, char **argv, char **env)
The environment is used to extract the PATH list (see ajWhich)
Note that the environment is passed through unaltered. The exec'd
program is passed a new argv array
Synopsis
Prototype
ajint ajSysExecEnvC (
const char* cmdlinetxt,
char* const[] env
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | The command line |
char* const[] | env | Input | The environment |
ajint | | RETURN | Exit status |
Input
cmdlinetxt: | (Input) | The command line |
env: | (Input) | The environment |
Returns
Description
Exec a command line as if from the C shell
This routine must be passed the environment received from
main(ajint argc, char **argv, char **env)
The environment is used to extract the PATH list (see ajWhich)
Note that the environment is passed through unaltered. The exec'd
program is passed a new argv array
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell
This routine must be passed the environment received from
main(ajint argc, char **argv, char **env)
The environment is used to extract the PATH list (see ajWhich)
Note that the environment is passed through unaltered. The exec'd
program is passed a new argv array
Synopsis
Prototype
ajint ajSysExecEnvS (
const AjPStr cmdline,
char* const[] env
);
Type | Name | Read/Write | Description |
const AjPStr | cmdline | Input | The command line |
char* const[] | env | Input | The environment |
ajint | | RETURN | Exit status |
Input
cmdline: | (Input) | The command line |
env: | (Input) | The environment |
Returns
Description
Exec a command line as if from the C shell
This routine must be passed the environment received from
main(ajint argc, char **argv, char **env)
The environment is used to extract the PATH list (see ajWhich)
Note that the environment is passed through unaltered. The exec'd
program is passed a new argv array
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell with a defined locale
variable.
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecLocaleC (
const char* cmdlinetxt,
const char* localetxt
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | The command line |
const char* | localetxt | Input | The locale value |
ajint | | RETURN | Exit status |
Input
cmdlinetxt: | (Input) | The command line |
localetxt: | (Input) | The locale value |
Returns
Description
Exec a command line as if from the C shell with a defined locale
variable.
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell with a defined locale
variable.
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecLocaleS (
const AjPStr cmdline,
const AjPStr localestr
);
Type | Name | Read/Write | Description |
const AjPStr | cmdline | Input | The command line |
const AjPStr | localestr | Input | The locale value |
ajint | | RETURN | Exit status |
Input
cmdline: | (Input) | The command line |
localestr: | (Input) | The locale value |
Returns
Description
Exec a command line as if from the C shell with a defined locale
variable.
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell with standard output redirected
to and overwriting a named file
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecOutnameC (
const char* cmdlinetxt,
const char* outfnametxt
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | The command line |
const char* | outfnametxt | Input | The output file name |
ajint | | RETURN | Exit status |
Input
cmdlinetxt: | (Input) | The command line |
outfnametxt: | (Input) | The output file name |
Returns
Description
Exec a command line as if from the C shell with standard output redirected
to and overwriting a named file
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell with standard output redirected
to and overwriting a named file
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecOutnameS (
const AjPStr cmdline,
const AjPStr outfname
);
Type | Name | Read/Write | Description |
const AjPStr | cmdline | Input | The command line |
const AjPStr | outfname | Input | The output file name |
ajint | | RETURN | Exit status |
Input
cmdline: | (Input) | The command line |
outfname: | (Input) | The output file name |
Returns
Description
Exec a command line as if from the C shell with standard output redirected
to and overwriting a named file
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell with standard output redirected
and appended to a named file
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecOutnameAppendC (
const char* cmdlinetxt,
const char* outfnametxt
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | The command line |
const char* | outfnametxt | Input | The output file name |
ajint | | RETURN | Exit status |
Input
cmdlinetxt: | (Input) | The command line |
outfnametxt: | (Input) | The output file name |
Returns
Description
Exec a command line as if from the C shell with standard output redirected
and appended to a named file
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell with standard output redirected
and appended to a named file
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecOutnameAppendS (
const AjPStr cmdline,
const AjPStr outfname
);
Type | Name | Read/Write | Description |
const AjPStr | cmdline | Input | The command line |
const AjPStr | outfname | Input | The output file name |
ajint | | RETURN | Exit status |
Input
cmdline: | (Input) | The command line |
outfname: | (Input) | The output file name |
Returns
Description
Exec a command line as if from the C shell with standard output redirected
and appended to a named file
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell with standard output and
standard error redirected to and overwriting a named file
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecOutnameErrC (
const char* cmdlinetxt,
const char* outfnametxt
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | The command line |
const char* | outfnametxt | Input | The output file name |
ajint | | RETURN | Exit status |
Input
cmdlinetxt: | (Input) | The command line |
outfnametxt: | (Input) | The output file name |
Returns
Description
Exec a command line as if from the C shell with standard output and
standard error redirected to and overwriting a named file
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell with standard output and
standard error redirected to and overwriting a named file
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecOutnameErrS (
const AjPStr cmdline,
const AjPStr outfname
);
Type | Name | Read/Write | Description |
const AjPStr | cmdline | Input | The command line |
const AjPStr | outfname | Input | The output file name |
ajint | | RETURN | Exit status |
Input
cmdline: | (Input) | The command line |
outfname: | (Input) | The output file name |
Returns
Description
Exec a command line as if from the C shell with standard output and
standard error redirected to and overwriting a named file
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell with standard output and
standard error redirected and appended to a named file
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecOutnameErrAppendC (
const char* cmdlinetxt,
const char* outfnametxt
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | The command line |
const char* | outfnametxt | Input | The output file name |
ajint | | RETURN | Exit status |
Input
cmdlinetxt: | (Input) | The command line |
outfnametxt: | (Input) | The output file name |
Returns
Description
Exec a command line as if from the C shell with standard output and
standard error redirected and appended to a named file
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line as if from the C shell with standard output and
standard error redirected and appended to a named file
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecOutnameErrAppendS (
const AjPStr cmdline,
const AjPStr outfname
);
Type | Name | Read/Write | Description |
const AjPStr | cmdline | Input | The command line |
const AjPStr | outfname | Input | The output file name |
ajint | | RETURN | Exit status |
Input
cmdline: | (Input) | The command line |
outfname: | (Input) | The output file name |
Returns
Description
Exec a command line as if from the C shell with standard output and
standard error redirected and appended to a named file
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line with a test for the program name in the current path
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecPathC (
const char* cmdlinetxt
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | The command line |
ajint | | RETURN | Exit status |
Input
cmdlinetxt: | (Input) | The command line |
Returns
Description
Exec a command line with a test for the program name in the current path
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line with a test for the program name in the current path
The exec'd program is passed a new argv array in argptr
Synopsis
Prototype
ajint ajSysExecPathS (
const AjPStr cmdline
);
Type | Name | Read/Write | Description |
const AjPStr | cmdline | Input | The command line |
ajint | | RETURN | Exit status |
Input
cmdline: | (Input) | The command line |
Returns
Description
Exec a command line with a test for the program name in the current path
The exec'd program is passed a new argv array in argptr
See Also
See other functions in this section
Availability
In release 6.4.0
Execute an application redirecting its stdin/out to pipe fds
Synopsis
Prototype
AjBool ajSysExecRedirectC (
const char* cmdlinetxt,
int** pipeto,
int** pipefrom
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | Command string.
The string may end with a trailing pipe character. |
int** | pipeto | Output | pipes to the process |
int** | pipefrom | Output | pipes from the process |
AjBool | | RETURN | True on success |
Input
cmdlinetxt: | (Input) | Command string.
The string may end with a trailing pipe character. |
Output
pipeto: | (Output) | pipes to the process |
pipefrom: | (Output) | pipes from the process |
Returns
Description
Execute an application redirecting its stdin/out to pipe fds
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for executing programs
Functions: ajSysExecprogNowaitC ajSysExecprogNowaitS
Exec a command line with no parent wait
This routine must be passed a program, an argument list and an environment.
The wait handling is performed by user-supplied parent process code and
is therefore used by the Java Native Interface software.
Synopsis
Prototype
ajint ajSysExecprogNowaitC (
const char* prog,
char* const[] arg,
char* const[] env
);
Type | Name | Read/Write | Description |
const char* | prog | Input | The command line |
char* const[] | arg | Input | Argument list |
char* const[] | env | Input | An environment |
ajint | | RETURN | Exit status |
Input
prog: | (Input) | The command line |
arg: | (Input) | Argument list |
env: | (Input) | An environment |
Returns
Description
Exec a command line with no parent wait
This routine must be passed a program, an argument list and an environment.
The wait handling is performed by user-supplied parent process code and
is therefore used by the Java Native Interface software.
See Also
See other functions in this section
Availability
In release 6.4.0
Exec a command line with no parent wait
This routine must be passed a program, an argument list and an environment.
The wait handling is performed by user-supplied parent process code and
is therefore used by the Java Native Interface software.
Synopsis
Prototype
ajint ajSysExecprogNowaitS (
const AjPStr progstr,
char* const[] arg,
char* const[] env
);
Type | Name | Read/Write | Description |
const AjPStr | progstr | Input | The command line |
char* const[] | arg | Input | Argument list |
char* const[] | env | Input | An environment |
ajint | | RETURN | Exit status |
Input
progstr: | (Input) | The command line |
arg: | (Input) | Argument list |
env: | (Input) | An environment |
Returns
Description
Exec a command line with no parent wait
This routine must be passed a program, an argument list and an environment.
The wait handling is performed by user-supplied parent process code and
is therefore used by the Java Native Interface software.
See Also
See other functions in this section
Availability
In release 6.4.0
Miscellaneous system functions
Functions: ajSysCanon ajSysFdFromSocket ajSysSocketclose ajSysTimeoutSet ajSysTimeoutUnset
Sets or unsets TTY canonical mode
Synopsis
Prototype
void ajSysCanon (
AjBool state
);
Type | Name | Read/Write | Description |
AjBool | state | Input | state=true sets canon state=false sets noncanon |
void | | RETURN | |
Input
state: | (Input) | state=true sets canon state=false sets noncanon |
Returns
Description
Sets or unsets TTY canonical mode
See Also
See other functions in this section
Availability
In release 6.4.0
Return a file descriptor from a UNIX of Windows socket
Synopsis
Prototype
FILE* ajSysFdFromSocket (
const struct AJSOCKET sock,
const char* mode
);
Type | Name | Read/Write | Description |
const struct AJSOCKET | sock | Input | AJAX socket structure |
const char* | mode | Input | Opening mode ("r" or "a") |
FILE* | | RETURN | File descriptor |
Input
sock: | (Input) | AJAX socket structure |
mode: | (Input) | Opening mode ("r" or "a") |
Returns
Description
Return a file descriptor from a UNIX of Windows socket
See Also
See other functions in this section
Availability
In release 6.4.0
Closes a UNIX or WIN32 socket
Synopsis
Prototype
void ajSysSocketclose (
struct AJSOCKET sock
);
Type | Name | Read/Write | Description |
struct AJSOCKET | sock | Modify | AJAX socket structure |
void | | RETURN | |
Input & Output
sock: | (Modify) | AJAX socket structure |
Returns
Description
Closes a UNIX or WIN32 socket
See Also
See other functions in this section
Availability
In release 6.4.0
Sets an alarm abort timeout for UNIX and Windows
Synopsis
Prototype
int ajSysTimeoutSet (
struct AJTIMEOUT* ts
);
Type | Name | Read/Write | Description |
struct AJTIMEOUT* | ts | Modify | AJAX timeout structure |
int | | RETURN | 0 = success -1 = error |
Input & Output
ts: | (Modify) | AJAX timeout structure |
Returns
int: | 0 = success -1 = error |
Description
Sets an alarm abort timeout for UNIX and Windows
See Also
See other functions in this section
Availability
In release 6.4.0
Unsets an alarm abort timeout for UNIX and Windows
Synopsis
Prototype
int ajSysTimeoutUnset (
struct AJTIMEOUT* ts
);
Type | Name | Read/Write | Description |
struct AJTIMEOUT* | ts | Modify | AJAX timeout structure |
int | | RETURN | 0 = success -1 = error |
Input & Output
ts: | (Modify) | AJAX timeout structure |
Returns
int: | 0 = success -1 = error |
Description
Unsets an alarm abort timeout for UNIX and Windows
See Also
See other functions in this section
Availability
In release 6.4.0
system command lines piped to a file
Functions: ajSysCreateInpipeC ajSysCreateInpipeS
Return a new file object from which to read the output from a command.
Synopsis
Prototype
AjPFile ajSysCreateInpipeC (
const char* cmdlinetxt
);
Type | Name | Read/Write | Description |
const char* | cmdlinetxt | Input | Command string.
The string may end with a trailing pipe character. |
AjPFile | | RETURN | New file object. |
Input
cmdlinetxt: | (Input) | Command string.
The string may end with a trailing pipe character. |
Returns
Description
Return a new file object from which to read the output from a command.
See Also
See other functions in this section
Availability
In release 6.4.0
Return a new file object from which to read the output from a command.
Synopsis
Prototype
AjPFile ajSysCreateInpipeS (
const AjPStr command
);
Type | Name | Read/Write | Description |
const AjPStr | command | Input | Command string.
The string may end with a trailing pipe character. |
AjPFile | | RETURN | New file object. |
Input
command: | (Input) | Command string.
The string may end with a trailing pipe character. |
Returns
Description
Return a new file object from which to read the output from a command.
See Also
See other functions in this section
Availability
In release 6.4.0
Functions called on exit from the program by ajExit to do
any necessary cleanup and to report internal statistics to the debug file
Functions: ajSysExit
Cleans up system internals memory
Synopsis
Prototype
void ajSysExit (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Cleans up system internals memory
See Also
See other functions in this section
Availability
In release 6.4.0