29 #if defined (HAVE_CONFIG_H)
62 static bool have_rdev =
64 static bool have_blksize =
66 static bool have_blocks =
73 m.
assign (
"dev", static_cast<double> (fs.
dev ()));
80 m.
assign (
"rdev", have_rdev ? static_cast<double> (fs.
rdev ()) : nan);
119 if (
args.length () != 2)
129 if (i_old >= 0 && i_new >= 0)
135 return ovl (status, msg);
164 if (nargin < 1 || nargin > 2)
167 std::string exec_file =
args(0).xstring_value (
"exec: FILE must be a string");
175 int len = tmp.
numel ();
177 exec_args.
resize (len + 1);
179 exec_args[0] = exec_file;
181 for (
int i = 0;
i < len;
i++)
182 exec_args[
i+1] = tmp[
i];
188 exec_args[0] = exec_file;
200 return ovl (status, msg);
250 int nargin =
args.length ();
252 if (nargin < 1 || nargin > 3)
255 std::string exec_file =
args(0).xstring_value (
"popen2: COMMAND argument must be a string");
261 string_vector tmp =
args(1).xstring_vector_value (
"popen2: all arguments must be strings");
263 int len = tmp.
numel ();
265 arg_list.
resize (len + 1);
267 arg_list[0] = exec_file;
269 for (
int i = 0;
i < len;
i++)
270 arg_list[
i+1] = tmp[
i];
276 arg_list[0] = exec_file;
279 bool sync_mode = (nargin == 3 ?
args(2).bool_value () :
false);
288 error (msg.c_str ());
290 FILE *ifile = fdopen (filedesc[1],
"r");
291 FILE *
ofile = fdopen (filedesc[0],
"w");
433 if (
args.length () != 3)
442 int req =
args(1).int_value (
true);
443 int arg =
args(2).int_value (
true);
447 error (
"fcntl: invalid file id");
453 return ovl (status, msg);
479 if (
args.length () != 0)
483 error (
"fork: cannot be called from command line");
489 return ovl (pid, msg);
498 if (
args.length () != 0)
505 return ovl (pid, msg);
515 if (
args.length () != 0)
528 if (
args.length () != 0)
541 if (
args.length () != 0)
554 if (
args.length () != 0)
567 if (
args.length () != 0)
580 if (
args.length () != 0)
608 if (
args.length () != 2)
611 pid_t pid =
args(0).int_value (
true);
613 int sig =
args(1).int_value (
true);
619 return ovl (status, msg);
633 if (
args.length () != 1)
646 convert (
int x,
int ibase,
int obase)
653 error (
"mkfifo: invalid digit");
657 while ((x = (x - tmp) / obase))
662 error (
"mkfifo: invalid digit");
664 retval += mult *
tmp;
686 if (
args.length () != 2)
691 int octal_mode =
args(1).xint_value (
"mkfifo: MODE must be an integer");
694 error (
"mkfifo: MODE must be a positive integer value");
696 int mode = convert (octal_mode, 8, 10);
702 return ovl (status, msg);
730 if (
args.length () != 0)
739 return ovl (-1, -1, -1, msg);
742 FILE *ifile = fdopen (fid[0],
"r");
743 FILE *
ofile = fdopen (fid[1],
"w");
854 if (
args.length () != 1)
859 if (
args(0).is_scalar_type ())
869 std::string fname =
args(0).xstring_value (
"stat: NAME must be a string");
889 if (
args.length () != 1)
892 double mode =
args(0).xdouble_value (
"S_ISREG: invalid MODE value");
907 if (
args.length () != 1)
910 double mode =
args(0).xdouble_value (
"S_ISDIR: invalid MODE value");
925 if (
args.length () != 1)
928 double mode =
args(0).xdouble_value (
"S_ISCHR: invalid MODE value");
943 if (
args.length () != 1)
946 double mode =
args(0).xdouble_value (
"S_ISBLK: invalid MODE value");
961 if (
args.length () != 1)
964 double mode =
args(0).xdouble_value (
"S_ISFIFO: invalid MODE value");
979 if (
args.length () != 1)
982 double mode =
args(0).xdouble_value (
"S_ISLNK: invalid MODE value");
997 if (
args.length () != 1)
1000 double mode =
args(0).xdouble_value (
"S_ISSOCK: invalid MODE value");
1011 if (
args.length () != 0)
1042 if (
args.length () != 0)
1069 if (
args.length () != 1)
1072 std::string name =
args(0).xstring_value (
"unlink: FILE must be a string");
1078 return ovl (status, msg);
1128 int nargin =
args.length ();
1130 if (nargin != 1 && nargin != 2)
1133 pid_t pid =
args(0).xint_value (
"waitpid: OPTIONS must be an integer");
1138 options =
args(1).xint_value (
"waitpid: PID must be an integer value");
1145 return ovl (result, status, msg);
1156 if (
args.length () != 1)
1159 int status =
args(0).xint_value (
"WIFEXITED: STATUS must be an integer");
1174 if (
args.length () != 1)
1177 int status =
args(0).xint_value (
"WEXITSTATUS: STATUS must be an integer");
1190 if (
args.length () != 1)
1193 int status =
args(0).xint_value (
"WIFSIGNALED: STATUS must be an integer");
1208 if (
args.length () != 1)
1211 int status =
args(0).xint_value (
"WTERMSIG: STATUS must be an integer");
1228 if (
args.length () != 1)
1231 int status =
args(0).xint_value (
"WCOREDUMP: STATUS must be an integer");
1247 if (
args.length () != 1)
1250 int status =
args(0).xint_value (
"WIFSTOPPED: STATUS must be an integer");
1265 if (
args.length () != 1)
1268 int status =
args(0).xint_value (
"WSTOPSIG: STATUS must be an integer");
1281 if (
args.length () != 1)
1284 int status =
args(0).xint_value (
"WIFCONTINUED: STATUS must be an integer");
1298 if (
args.length () != 1)
1301 std::string name =
args(0).xstring_value (
"canonicalize_file_name: NAME must be a string");
1307 return ovl (result, msg.empty () ? 0 : -1, msg);
1332 return const_value (args, val);
1348 return const_value (args, val);
1364 return const_value (args, val);
1380 return const_value (args, val);
1396 return const_value (args, val);
1413 return const_value (args, val);
1429 return const_value (args, val);
1446 return const_value (args, val);
1462 return const_value (args, val);
1479 return const_value (args, val);
1495 return const_value (args, val);
1512 return const_value (args, val);
1529 return const_value (args, val);
1546 return const_value (args, val);
1562 return const_value (args, val);
OCTINTERP_API octave_value_list FWTERMSIG(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list FO_TRUNC(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list Fwaitpid(const octave_value_list &=octave_value_list(), int=0)
int dup2(int old_fd, int new_fd)
OCTINTERP_API octave_value_list FO_APPEND(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list FO_RDWR(const octave_value_list &=octave_value_list(), int=0)
octave::sys::time mtime(void) const
std::string canonicalize_file_name(const std::string &name)
OCTINTERP_API octave_value_list Ffcntl(const octave_value_list &=octave_value_list(), int=0)
static bool at_top_level(void)
int fcntl(int fd, int cmd, long arg)
OCTINTERP_API octave_value_list FWUNTRACED(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list Ffork(const octave_value_list &=octave_value_list(), int=0)
int octave_o_creat_wrapper(void)
OCTINTERP_API octave_value_list FO_ASYNC(const octave_value_list &=octave_value_list(), int=0)
int kill(pid_t pid, int sig)
OCTINTERP_API octave_value_list Fmkfifo(const octave_value_list &=octave_value_list(), int=0)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
int unlink(const std::string &name)
OCTINTERP_API void print_usage(void)
OCTINTERP_API octave_value_list FF_GETFD(const octave_value_list &=octave_value_list(), int=0)
octave_idx_type numel(void) const
Number of elements in the array.
identity matrix If supplied two scalar respectively For allows like xample val
OCTINTERP_API octave_value_list FWIFEXITED(const octave_value_list &=octave_value_list(), int=0)
octave_idx_type length(void) const
OCTINTERP_API octave_value_list FS_ISSOCK(const octave_value_list &=octave_value_list(), int=0)
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
std::string sysname(void) const
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
OCTINTERP_API octave_value_list Fgetgid(const octave_value_list &=octave_value_list(), int=0)
int octave_o_append_wrapper(void)
OCTINTERP_API octave_value_list FS_ISCHR(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list FWEXITSTATUS(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list Fgetppid(const octave_value_list &=octave_value_list(), int=0)
std::string version(void) const
int octave_f_getfd_wrapper(void)
OCTINTERP_API octave_value_list Fstat(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list FS_ISLNK(const octave_value_list &=octave_value_list(), int=0)
static void clean_up_and_save(const std::string &="", int=-1)
OCTINTERP_API octave_value_list FS_ISREG(const octave_value_list &=octave_value_list(), int=0)
int octave_f_setfl_wrapper(void)
void resize(octave_idx_type n, const std::string &rfv="")
OCTINTERP_API octave_value_list FS_ISFIFO(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list Fgeteuid(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list FF_SETFL(const octave_value_list &=octave_value_list(), int=0)
int octave_f_dupfd_wrapper(void)
OCTINTERP_API octave_value_list FWNOHANG(const octave_value_list &=octave_value_list(), int=0)
bool wifstopped(int status)
OCTINTERP_API octave_value_list FO_WRONLY(const octave_value_list &=octave_value_list(), int=0)
static octave_scalar_map mk_stat_map(const octave::sys::base_file_stat &fs)
OCTINTERP_API octave_value_list Fgetegid(const octave_value_list &=octave_value_list(), int=0)
int octave_f_getfl_wrapper(void)
static int insert(octave_stream &os)
bool wifsignaled(int status)
OCTINTERP_API octave_value_list Fkill(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list FF_DUPFD(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list Fpipe(const octave_value_list &=octave_value_list(), int=0)
pid_t waitpid(pid_t pid, int *status, int options)
void octave_history_write_timestamp(void)
static octave_value_list mk_stat_result(const octave::sys::base_file_stat &fs)
nd deftypefn *octave_map m
octave::sys::time atime(void) const
static bool have_struct_stat_st_blocks(void)
int wexitstatus(int status)
static std::string get_host_name(void)
OCTINTERP_API octave_value_list FWSTOPSIG(const octave_value_list &=octave_value_list(), int=0)
static bool have_struct_stat_st_rdev(void)
OCTINTERP_API octave_value_list Fexec(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list FO_NONBLOCK(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list Fgetuid(const octave_value_list &=octave_value_list(), int=0)
#define DEFUNX(name, fname, args_name, nargout_name, doc)
OCTINTERP_API octave_value_list FF_GETFL(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list FWIFSTOPPED(const octave_value_list &=octave_value_list(), int=0)
int octave_o_rdonly_wrapper(void)
int wcoredump(int status)
static octave_stream lookup(int fid, const std::string &who="")
OCTINTERP_API octave_value_list Flstat(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list Fpopen2(const octave_value_list &=octave_value_list(), int=0)
bool wifexited(int status)
OCTINTERP_API octave_value_list FWIFCONTINUED(const octave_value_list &=octave_value_list(), int=0)
With real return the complex result
int octave_o_async_wrapper(void)
static octave_stream create(const std::string &n, FILE *f=0, std::ios::openmode m=std::ios::in|std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), c_file_ptr_buf::close_fcn cf=c_file_ptr_buf::file_close)
OCTINTERP_API octave_value_list FWIFSIGNALED(const octave_value_list &=octave_value_list(), int=0)
std::ofstream ofile(filename.c_str(), std::ios::out|std::ios::binary)
OCTINTERP_API octave_value_list FWCOREDUMP(const octave_value_list &=octave_value_list(), int=0)
std::string nodename(void) const
OCTINTERP_API octave_value_list FWCONTINUE(const octave_value_list &=octave_value_list(), int=0)
int octave_o_nonblock_wrapper(void)
OCTINTERP_API octave_value_list Fgetpgrp(const octave_value_list &=octave_value_list(), int=0)
=val(i)}if ode{val(i)}occurs in table i
OCTINTERP_API octave_value_list FO_RDONLY(const octave_value_list &=octave_value_list(), int=0)
int octave_o_trunc_wrapper(void)
void assign(const std::string &k, const octave_value &val)
OCTINTERP_API octave_value_list FO_CREAT(const octave_value_list &=octave_value_list(), int=0)
bool wifcontinued(int status)
int execvp(const std::string &file, const string_vector &argv)
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid options
OCTAVE_EXPORT octave_value_list Fdup2(const octave_value_list &args, int) ar
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol NaN(Not a Number).NaN is the result of operations which do not produce a well defined 0 result.Common operations which produce a NaN are arithmetic with infinity ex($\infty-\infty $)
static bool ignoring_entries(void)
int octave_o_sync_wrapper(void)
int octave_o_wronly_wrapper(void)
int octave_o_rdwr_wrapper(void)
octave::sys::file_stat fs(filename)
OCTINTERP_API octave_value_list Fgetpid(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list FO_SYNC(const octave_value_list &=octave_value_list(), int=0)
int octave_o_excl_wrapper(void)
OCTINTERP_API octave_value_list Funlink(const octave_value_list &=octave_value_list(), int=0)
pid_t fork(std::string &msg)
std::string error(void) const
OCTINTERP_API octave_value_list Fcanonicalize_file_name(const octave_value_list &=octave_value_list(), int=0)
octave::sys::time ctime(void) const
OCTINTERP_API octave_value_list FS_ISDIR(const octave_value_list &=octave_value_list(), int=0)
write the output to stdout if nargout is
std::string machine(void) const
static int get_file_number(const octave_value &fid)
OCTINTERP_API octave_value_list FF_SETFD(const octave_value_list &=octave_value_list(), int=0)
int octave_f_setfd_wrapper(void)
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
static bool have_struct_stat_st_blksize(void)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
OCTINTERP_API octave_value_list FO_EXCL(const octave_value_list &=octave_value_list(), int=0)
nlink_t nlink(void) const
pid_t getpgrp(std::string &msg)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
std::string release(void) const
int mkfifo(const std::string &nm, mode_t md)
std::string message(void) const
OCTINTERP_API octave_value_list FS_ISBLK(const octave_value_list &=octave_value_list(), int=0)
pid_t popen2(const std::string &cmd, const string_vector &args, bool sync_mode, int *fildes)
std::string mode_as_string(void) const