file_manip.cpp File Reference

#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <utime.h>
#include <limits.h>
#include <stdlib.h>
#include <cstdio>
#include <cerrno>
#include <iostream>
#include <fstream>
#include <vector>
#include "op_file.h"
#include "file_manip.h"
#include "string_manip.h"
Include dependency graph for file_manip.cpp:

Go to the source code of this file.

Functions

bool copy_file (string const &source, string const &destination)
bool is_directory (string const &dirname)
bool is_files_identical (string const &file1, string const &file2)
string const op_realpath (string const &name)
bool op_file_readable (string const &file)
static void get_pathname (const char *pathname, void *name_list)
bool create_file_list (list< string > &file_list, string const &base_dir, string const &filter, bool recursive)
static string erase_trailing_path_separator (string const &path_name)
string op_dirname (string const &file_name)
string op_basename (string const &path_name)

Detailed Description

Useful file management helpers

Remarks:
Copyright 2002 OProfile authors
Read the file COPYING
Author:
Philippe Elie
John Levon

Definition in file file_manip.cpp.


Function Documentation

bool copy_file ( string const &  source,
string const &  destination 
)

Definition at line 33 of file file_manip.cpp.

References op_file_readable().

Here is the call graph for this function:

bool create_file_list ( list< string > &  file_list,
string const &  base_dir,
string const &  filter,
bool  recursive 
)

Definition at line 118 of file file_manip.cpp.

References get_matching_pathnames(), get_pathname(), MATCH_ANY_ENTRY_RECURSION, and NO_RECURSION.

Referenced by create_file_list_tests(), and profile_spec::generate_file_list().

Here is the call graph for this function:

Here is the caller graph for this function:

static string erase_trailing_path_separator ( string const &  path_name  )  [static]
Parameters:
path_name the path where we remove trailing '/'

erase all trailing '/' in path_name except if the last '/' is at pos 0

Definition at line 134 of file file_manip.cpp.

Referenced by op_basename(), and op_dirname().

Here is the caller graph for this function:

static void get_pathname ( const char *  pathname,
void *  name_list 
) [static]

Definition at line 112 of file file_manip.cpp.

Referenced by create_file_list().

Here is the caller graph for this function:

bool is_directory ( string const &  dirname  ) 

Definition at line 77 of file file_manip.cpp.

Referenced by is_directory_tests().

Here is the caller graph for this function:

bool is_files_identical ( string const &  file1,
string const &  file2 
)

Definition at line 84 of file file_manip.cpp.

Referenced by is_files_identical_tests().

Here is the caller graph for this function:

string op_basename ( string const &  path_name  ) 
string op_dirname ( string const &  file_name  ) 

Definition at line 147 of file file_manip.cpp.

References erase_trailing_path_separator().

Referenced by dirname_tests(), and find_separate_debug_file().

Here is the call graph for this function:

Here is the caller graph for this function:

bool op_file_readable ( string const &  file  ) 

Definition at line 107 of file file_manip.cpp.

References op_file_readable().

Here is the call graph for this function:

string const op_realpath ( string const &  name  ) 

Definition at line 98 of file file_manip.cpp.

Referenced by daemon_status::daemon_status(), profile_spec::generate_file_list(), and realpath_tests().

Here is the caller graph for this function:


Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1