GNU Octave  4.0.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 <tempname.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 206 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 727 of file file-ops.cc.

References free().

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

Definition at line 440 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 447 of file file-ops.cc.

References link().

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

Definition at line 392 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 399 of file file-ops.cc.

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

Definition at line 414 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 421 of file file-ops.cc.

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

Definition at line 486 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 493 of file file-ops.cc.

References MAXPATHLEN.

int octave_recursive_rmdir ( const std::string &  name)

Definition at line 564 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 517 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 524 of file file-ops.cc.

int octave_rmdir ( const std::string &  name)

Definition at line 540 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 547 of file file-ops.cc.

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

Definition at line 463 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 470 of file file-ops.cc.

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)

Definition at line 639 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 656 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 103 of file file-ops.cc.

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

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