Back to index

nordugrid-arc-nox  1.1.0~rc6
Functions
delete.h File Reference
#include <string>
#include <list>
#include "../files/info_types.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int delete_all_files (const std::string &dir_base, const std::list< FileData > &files, bool excl, bool lfn_exs=true, bool lfn_mis=true)
int delete_all_links (const std::string &dir_base, const std::list< FileData > &files)

Function Documentation

int delete_all_files ( const std::string &  dir_base,
const std::list< FileData > &  files,
bool  excl,
bool  lfn_exs = true,
bool  lfn_mis = true 
)

Definition at line 163 of file delete.cpp.

                                                  {
  int n = files.size();
  FL_p* fl_list = NULL;
  if(n != 0) { 
    if((fl_list=(FL_p*)malloc(sizeof(FL_p)*n)) == NULL) { return 2; };
    std::list<FileData>::const_iterator file=files.begin();
//    fl_list[0].s=file->pfn.c_str();
    int i;
    for(i=0;i<n;) {
      if(((lfn_exs) && (file->lfn.find(':') != std::string::npos)) ||
         ((lfn_mis) && (file->lfn.find(':') == std::string::npos))) {
        if(excl) {
          if(file->pfn == "/") { /* keep all requested */
            free(fl_list); return 0;
          };
        };
        fl_list[i].s=file->pfn.c_str();
        if(i) { fl_list[i].prev=fl_list+(i-1); fl_list[i-1].next=fl_list+i; }
        else { fl_list[i].prev=NULL; };
        fl_list[i].next=NULL;
        i++;
      };
      ++file; if(file == files.end()) break;
    };
    if(i==0) { free(fl_list); fl_list=NULL; };
  };
  std::string dir_cur("");
  FL_p* fl_list_tmp = fl_list;
  int res=delete_all_recur(dir_base,dir_cur,&fl_list_tmp,excl);
  if(fl_list) free(fl_list);
  return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int delete_all_links ( const std::string &  dir_base,
const std::list< FileData > &  files 
)

Definition at line 157 of file delete.cpp.

                                                                         {
  std::string dir_cur("");
  return delete_links_recur(dir_base,dir_cur);
}

Here is the call graph for this function: