Function Reference

System Utilities

Timing Utilities

time
Return the current time as the number of seconds since the epoch.
now
Returns the current local time as the number of days since Jan 1, 0000.
ctime
Convert a value returned from `time' (or any other nonnegative integer), to the local time and return a string of the same form as `asctime'.
gmtime
Given a value returned from time (or any nonnegative integer), return a time structure corresponding to CUT.
localtime
Given a value returned from time (or any nonnegative integer), return a time structure corresponding to the local time zone.
mktime
Convert a time structure corresponding to the local time to the number of seconds since the epoch.
asctime
Convert a time structure to a string using the following five-field format: Thu Mar 28 08:40:14 1996.
strftime
Format the time structure TM_STRUCT in a flexible way using the format string FMT that contains `%' substitutions similar to those in `printf'.
strptime
Convert the string STR to the time structure TM_STRUCT under the control of the format string FMT.
clock
Return a vector containing the current year, month (1-12), day (1-31), hour (0-23), minute (0-59) and second (0-61).
date
Return the date as a character string in the form DD-MMM-YY.
etime
Return the difference (in seconds) between two time values returned from `clock'.
cputime
Return the CPU time used by your Octave session.
is_leap_year
Return 1 if the given year is a leap year and 0 otherwise.
tic
Set or check a wall-clock timer.
pause
Suspend the execution of the program.
sleep
Suspend the execution of the program for the given number of seconds.
usleep
Suspend the execution of the program for the given number of microseconds.
datenum
Returns the specified local time as a day number, with Jan 1, 0000 being day 1.
datestr
Format the given date/time according to the format `f' and return the result in STR.
datevec
Convert a serial date number (see `datenum') or date string (see `datestr') into a date vector.
addtodate
Add Q amount of time (with units F) to the datenum, D.
calendar
If called with no arguments, return the current monthly calendar in a 6x7 matrix.
weekday
Return the day of week as a number in N and a string in S, for example `[1, "Sun"]', `[2, "Mon"]', .
eomday
Return the last day of the month M for the year Y.

Filesystem Utilities

rename
Change the name of file OLD to NEW.
link
Create a new link (also known as a hard link) to an existing file.
symlink
Create a symbolic link NEW which contains the string OLD.
readlink
Read the value of the symbolic link SYMLINK.
unlink
Delete the file named FILE.
readdir
Return names of the files in the directory DIR as a cell array of strings.
mkdir
Create a directory named DIR in the directory PARENT.
rmdir
Remove the directory named DIR.
confirm_recursive_rmdir
Query or set the internal variable that controls whether Octave will ask for confirmation before recursively removing a directory tree.
mkfifo
Create a FIFO special file named NAME with file mode MODE
umask
Set the permission mask for file creation.
stat
Return a structure S containing the following information about FILE.
lstat
See stat.
fileattrib
Return information about FILE.
isdir
Return true if F is a directory.
glob
Given an array of strings (as a char array or a cell array) in PATTERN, return a cell array of file names that match any of them, or an empty cell array if no patterns match.
fnmatch
Return 1 or zero for each element of STRING that matches any of the elements of the string array PATTERN, using the rules of filename pattern matching.
file_in_path
Return the absolute name of FILE if it can be found in PATH.
tilde_expand
Performs tilde expansion on STRING.
canonicalize_file_name
Return the canonical name of file NAME.
movefile
Move the file F1 to the new name F2.
copyfile
Copy the file F1 to the new name F2.
fileparts
Return the directory, name, extension, and version components of FILENAME.
filesep
Return the system-dependent character used to separate directory names.
filemarker
Returns or sets the character used to separate filename from the the subfunction names contained within the file.
fullfile
Return a complete filename constructed from the given components.
tempdir
Return the name of the system's directory for temporary files.
tempname
This function is an alias for `tmpnam'.
P_tmpdir
Return the default name of the directory for temporary files on this system.

File Archiving Utilities

bunzip2
Unpack the bzip2 archive BZFILE to the directory DIR.
gzip
Compress the list of files and/or directories specified in FILES.
gunzip
Unpack the gzip archive GZFILE to the directory DIR.
tar
Pack FILES FILES into the TAR archive TARFILE.
untar
Unpack the TAR archive TARFILE to the directory DIR.
zip
Compress the list of files and/or directories specified in FILES into the archive ZIPFILES in the same directory.
unzip
Unpack the ZIP archive ZIPFILE to the directory DIR.
pack
This function is provided for compatibility with MATLAB, but it doesn't actually do anything.
unpack
Unpack the archive FILE based on its extension to the directory DIR.

Networking Utilities

urlread
Download a remote file specified by its URL and return its content in string S.
urlwrite
Download a remote file specified by its URL and save it as LOCALFILE.

Controlling Subprocesses

system
Execute a shell command specified by STRING.
unix
Execute a system command if running under a Unix-like operating system, otherwise do nothing.
dos
Execute a system command if running under a Windows-like operating system, otherwise do nothing.
perl
Invoke perl script SCRIPTFILE with possibly a list of command line arguments.
popen
Start a process and create a pipe.
pclose
Close a file identifier that was opened by `popen'.
popen2
Start a subprocess with two-way communication.
EXEC_PATH
Query or set the internal variable that specifies a colon separated list of directories to search when executing external programs.
fork
Create a copy of the current process.
exec
Replace current process with a new process.
pipe
Create a pipe and return the reading and writing ends of the pipe into READ_FD and WRITE_FD respectively.
dup2
Duplicate a file descriptor.
waitpid
Wait for process PID to terminate.
fcntl
Change the properties of the open file FID.
kill
Send signal SIG to process PID.
SIG
Return a structure containing Unix signal names and their defined values.

Process, Group, and User IDs

getpgrp
Return the process group id of the current process.
getpid
Return the process id of the current process.
getppid
Return the process id of the parent process.
geteuid
Return the effective user id of the current process.
getuid
Return the real user id of the current process.
getegid
Return the effective group id of the current process.
getgid
Return the real group id of the current process.

Environment Variables

getenv
Return the value of the environment variable VAR.
putenv
Set the value of the environment variable VAR to VALUE.

Current Working Directory

cd
Change the current working directory to DIR.
ls
List directory contents.
ls_command
Set or return the shell command used by Octave's `ls' command.
dir
Display file listing for directory DIRECTORY.
pwd
Return the current working directory.

Password Database Functions

getpwent
Return a structure containing an entry from the password database, opening it if necessary.
getpwuid
Return a structure containing the first entry from the password database with the user ID UID.
getpwnam
Return a structure containing the first entry from the password database with the user name NAME.
setpwent
Return the internal pointer to the beginning of the password database.
endpwent
Close the password database.

Group Database Functions

getgrent
Return an entry from the group database, opening it if necessary.
getgrgid
Return the first entry from the group database with the group ID GID.
getgrnam
Return the first entry from the group database with the group name NAME.
setgrent
Return the internal pointer to the beginning of the group database.
endgrent
Close the group database.

System Information

computer
Print or return a string of the form CPU-VENDOR-OS that identifies the kind of computer Octave is running on.
uname
Return system information in the structure.
ispc
Return 1 if Octave is running on a Windows system and 0 otherwise.
isunix
Return 1 if Octave is running on a Unix-like system and 0 otherwise.
isieee
Return 1 if your computer claims to conform to the IEEE standard for floating point calculations.
OCTAVE_HOME
Return the name of the top-level Octave installation directory.
OCTAVE_VERSION
Return the version number of Octave, as a string.
version
Return Octave's version number as a string.
ver
Display a header containing the current Octave version number, license string and operating system, followed by the installed package names, versions, and installation directories.
octave_config_info
Return a structure containing configuration and installation information for Octave.
getrusage
Return a structure containing a number of statistics about the current Octave process.

Hashing Functions

md5sum
Calculates the MD5 sum of the file FILE.