osprey/driver/file_utils.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <errno.h>
#include "errors.h"
#include "string_utils.h"
#include "file_utils.h"

Include dependency graph for file_utils.c:

Go to the source code of this file.

Defines

#define DIR_SEPARATOR   '/'
#define DIR_SEPARATOR_STR   "/"

Functions/Subroutines

char * drop_path (char *s)
char * directory_path (char *s)
char * concat_path (char *d, char *f)
boolean file_exists (char *path)
boolean is_executable (char *path)
boolean is_directory (char *path)
boolean want_directory (char *path)
boolean directory_is_writable (char *path)
char * get_cwd (void)
void file_utils_set_program_name (char *name)
static char * get_executable_dir_from_path (char *name)
char * get_executable_dir (void)
void dump_file_to_stdout (char *filename)

Variables

int errno
static char * saved_orig_program_name


Define Documentation

#define DIR_SEPARATOR   '/'

Definition at line 56 of file file_utils.c.

#define DIR_SEPARATOR_STR   "/"


Function Documentation

char* concat_path ( char *  d,
char *  f 
)

Definition at line 107 of file file_utils.c.

References concat_strings(), DIR_SEPARATOR_STR, malloc, NULL, path, strcat(), strcmp(), strcpy, and strlen().

boolean directory_is_writable ( char *  path  ) 

Definition at line 192 of file file_utils.c.

References concat_strings(), f, FALSE, fclose(), fd, fdopen, fopen, mkstemp(), mktemp, NULL, s, TRUE, and unlink.

Referenced by init_temp_files().

char* directory_path ( char *  s  ) 

char* drop_path ( char *  s  ) 

void dump_file_to_stdout ( char *  filename  ) 

Definition at line 345 of file file_utils.c.

References buf, f, fclose(), file_exists(), fopen, fread, internal_error(), n, NULL, and write.

boolean file_exists ( char *  path  ) 

void file_utils_set_program_name ( char *  name  ) 

Definition at line 232 of file file_utils.c.

References saved_orig_program_name.

Referenced by main().

char* get_cwd ( void   ) 

Definition at line 219 of file file_utils.c.

References cwd, getcwd, getenv(), MAXPATHLEN, NULL, and string_copy().

Referenced by write_command_string_into_file().

char* get_executable_dir ( void   ) 

static char* get_executable_dir_from_path ( char *  name  )  [static]

boolean is_directory ( char *  path  ) 

boolean is_executable ( char *  path  ) 

Definition at line 138 of file file_utils.c.

References ENOENT, ENOTDIR, errno, FALSE, S_IXGRP, S_IXOTH, S_IXUSR, stat::st_mode, and stat.

Referenced by get_executable_dir_from_path().

boolean want_directory ( char *  path  ) 

Definition at line 170 of file file_utils.c.

References fullwarn, is_directory(), TRUE, and warning.


Variable Documentation

int errno

char* saved_orig_program_name [static]

Definition at line 61 of file file_utils.c.

Referenced by file_utils_set_program_name(), and get_executable_dir().


Generated on Wed Apr 8 15:07:16 2009 for Open64 by  doxygen 1.5.6