GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
file-ops.cc File Reference
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "pathmax.h"
#include "canonicalize.h"
#include "dir-ops.h"
#include "file-ops.h"
#include "file-stat.h"
#include "oct-env.h"
#include "oct-locbuf.h"
#include "oct-passwd.h"
#include "pathlen.h"
#include "quit.h"
#include "singleton-cleanup.h"
#include "str-vec.h"
Include dependency graph for file-ops.cc:

Go to the source code of this file.

Functions

static std::string isolate_tilde_prefix (const std::string &fname)
std::string octave_canonicalize_file_name (const std::string &name)
std::string octave_canonicalize_file_name (const std::string &name, std::string &msg)
int octave_link (const std::string &old_name, const std::string &new_name)
int octave_link (const std::string &old_name, const std::string &new_name, std::string &msg)
int octave_mkdir (const std::string &nm, mode_t md)
int octave_mkdir (const std::string &name, mode_t mode, std::string &msg)
int octave_mkfifo (const std::string &nm, mode_t md)
int octave_mkfifo (const std::string &name, mode_t mode, std::string &msg)
int octave_readlink (const std::string &path, std::string &result)
int octave_readlink (const std::string &path, std::string &result, std::string &msg)
int octave_recursive_rmdir (const std::string &name)
int octave_recursive_rmdir (const std::string &name, std::string &msg)
int octave_rename (const std::string &from, const std::string &to)
int octave_rename (const std::string &from, const std::string &to, std::string &msg)
int octave_rmdir (const std::string &name)
int octave_rmdir (const std::string &name, std::string &msg)
int octave_symlink (const std::string &old_name, const std::string &new_name)
int octave_symlink (const std::string &old_name, const std::string &new_name, std::string &msg)
std::string octave_tempnam (const std::string &dir, const std::string &pfx)
std::string octave_tempnam (const std::string &dir, const std::string &pfx, std::string &msg)
int octave_umask (mode_t mode)
int octave_unlink (const std::string &name)
int octave_unlink (const std::string &name, std::string &msg)
static std::string tilde_expand_word (const std::string &filename)
static size_t tilde_find_prefix (const std::string &s, size_t &len)
static size_t tilde_find_suffix (const std::string &s)

Variables

static const chardefault_prefixes [] = { " ~", "\t~", ":~", 0 }
static const chardefault_suffixes [] = { " ", "\n", ":", 0 }

Function Documentation

static std::string isolate_tilde_prefix ( const std::string &  fname)
static

Definition at line 202 of file file-ops.cc.

References file_ops::is_dir_sep().

Referenced by tilde_expand_word().

std::string octave_canonicalize_file_name ( const std::string &  name)
std::string octave_canonicalize_file_name ( const std::string &  name,
std::string &  msg 
)

Definition at line 686 of file file-ops.cc.

References octave_env::make_absolute(), OCTAVE_LOCAL_BUFFER, and PATH_MAX.

int octave_link ( const std::string &  old_name,
const std::string &  new_name 
)

Definition at line 415 of file file-ops.cc.

References octave_link().

Referenced by Flink(), and octave_link().

int octave_link ( const std::string &  old_name,
const std::string &  new_name,
std::string &  msg 
)

Definition at line 422 of file file-ops.cc.

References link().

int octave_mkdir ( const std::string &  nm,
mode_t  md 
)

Definition at line 367 of file file-ops.cc.

References octave_mkdir().

Referenced by Fmkdir(), base_url_transfer::mget_directory(), and octave_mkdir().

int octave_mkdir ( const std::string &  name,
mode_t  mode,
std::string &  msg 
)

Definition at line 374 of file file-ops.cc.

int octave_mkfifo ( const std::string &  nm,
mode_t  md 
)

Definition at line 389 of file file-ops.cc.

References octave_mkfifo().

Referenced by Fmkfifo(), and octave_mkfifo().

int octave_mkfifo ( const std::string &  name,
mode_t  mode,
std::string &  msg 
)

Definition at line 396 of file file-ops.cc.

int octave_readlink ( const std::string &  path,
std::string &  result 
)

Definition at line 461 of file file-ops.cc.

References octave_readlink().

Referenced by Freadlink(), and octave_readlink().

int octave_readlink ( const std::string &  path,
std::string &  result,
std::string &  msg 
)

Definition at line 468 of file file-ops.cc.

References MAXPATHLEN.

int octave_recursive_rmdir ( const std::string &  name)

Definition at line 539 of file file-ops.cc.

References octave_recursive_rmdir().

Referenced by Frmdir(), and octave_recursive_rmdir().

int octave_recursive_rmdir ( const std::string &  name,
std::string &  msg 
)
int octave_rename ( const std::string &  from,
const std::string &  to 
)

Definition at line 492 of file file-ops.cc.

References octave_rename().

Referenced by Frename(), and octave_rename().

int octave_rename ( const std::string &  from,
const std::string &  to,
std::string &  msg 
)

Definition at line 499 of file file-ops.cc.

int octave_rmdir ( const std::string &  name)

Definition at line 515 of file file-ops.cc.

References octave_rmdir().

Referenced by Frmdir(), octave_recursive_rmdir(), and octave_rmdir().

int octave_rmdir ( const std::string &  name,
std::string &  msg 
)

Definition at line 522 of file file-ops.cc.

int octave_symlink ( const std::string &  old_name,
const std::string &  new_name 
)

Definition at line 438 of file file-ops.cc.

References octave_symlink().

Referenced by Fsymlink(), and octave_symlink().

int octave_symlink ( const std::string &  old_name,
const std::string &  new_name,
std::string &  msg 
)

Definition at line 445 of file file-ops.cc.

std::string octave_tempnam ( const std::string &  dir,
const std::string &  pfx 
)

Definition at line 646 of file file-ops.cc.

References octave_tempnam().

Referenced by Ftmpnam(), mk_tmp_hist_file(), and octave_tempnam().

std::string octave_tempnam ( const std::string &  dir,
const std::string &  pfx,
std::string &  msg 
)

Definition at line 653 of file file-ops.cc.

References tempnam().

int octave_umask ( mode_t  mode)

Definition at line 614 of file file-ops.cc.

Referenced by Fumask().

int octave_unlink ( const std::string &  name)
int octave_unlink ( const std::string &  name,
std::string &  msg 
)

Definition at line 631 of file file-ops.cc.

static std::string tilde_expand_word ( const std::string &  filename)
static
static size_t tilde_find_prefix ( const std::string &  s,
size_t len 
)
static
static size_t tilde_find_suffix ( const std::string &  s)
static

Variable Documentation

const char* default_prefixes[] = { " ~", "\t~", ":~", 0 }
static

Definition at line 99 of file file-ops.cc.

const char* default_suffixes[] = { " ", "\n", ":", 0 }
static

Definition at line 104 of file file-ops.cc.