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 "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 &name, mode_t mode, std::string &msg)
int octave_mkfifo (const std::string &nm, mode_t md)
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, std::string &msg)
int octave_rename (const std::string &from, const std::string &to)
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 &msg)
std::string octave_tempnam (const std::string &dir, const std::string &pfx)
int octave_umask (mode_t mode)
int octave_unlink (const std::string &name, std::string &msg)
int octave_unlink (const std::string &name)
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 201 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  ) 

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

References octave_canonicalize_file_name().

Referenced by DEFUNX(), and octave_canonicalize_file_name().

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

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

References octave_link().

Referenced by DEFUNX(), and octave_link().

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

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

References link().

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

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

References octave_mkdir().

Referenced by DEFUNX(), and octave_mkdir().

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

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

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

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

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

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

References octave_mkfifo().

Referenced by DEFUNX(), and octave_mkfifo().

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

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

References octave_readlink().

Referenced by DEFUNX(), and octave_readlink().

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

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

int octave_recursive_rmdir ( const std::string &  name  ) 

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

References octave_recursive_rmdir().

Referenced by DEFUNX(), 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,
std::string &  msg 
)

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

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

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

References octave_rename().

Referenced by DEFUNX(), and octave_rename().

int octave_rmdir ( const std::string &  name  ) 

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

References octave_rmdir().

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

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

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

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

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

References octave_symlink().

Referenced by DEFUNX(), and octave_symlink().

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

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

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

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

References tempnam().

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

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

References octave_tempnam().

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

int octave_umask ( mode_t  mode  ) 

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

Referenced by DEFUNX().

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

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

int octave_unlink ( const std::string &  name  ) 

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

References octave_unlink().

Referenced by DEFUNX(), octave_recursive_rmdir(), and octave_unlink().

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]

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

References string_vector::empty(), and Array< T >::length().

Referenced by file_ops::tilde_expand().

static size_t tilde_find_suffix ( const std::string &  s  )  [static]

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

References string_vector::empty(), file_ops::is_dir_sep(), and Array< T >::length().

Referenced by file_ops::tilde_expand().


Variable Documentation

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

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

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

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

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines