y_file_handler: add mkdir dst_dir, previous commit contain debug eof in receve from node
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#ifndef Y_FILE_HANDLER_T_H__C
|
||||
#define Y_FILE_HANDLER_T_H__C
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "y_socket_t/y_socket_t.h"
|
||||
#include "y_socket_t/y_node_t.h"
|
||||
#include "y_socket_t/y_list_var_tool.h"
|
||||
|
||||
@@ -928,6 +928,11 @@ void receve_from_node(struct pollfd *fds, struct main_list_y_ptr_HEADER_T *m_hea
|
||||
|
||||
char fileNameLocal[tmpCnt_l->value->size_nameid + len_dir + 1];
|
||||
if(dst_dir){
|
||||
if(mkdir(dst_dir, 0777) && errno != EEXIST)
|
||||
fprintf(stderr, "error while trying to create '%s'\n%m\n", dst_dir);
|
||||
else
|
||||
printf("debug:%s exists now\n", dst_dir);
|
||||
|
||||
sprintf(fileNameLocal, "%s/%s",dst_dir,tmpCnt_l->value->nameid);
|
||||
}else{
|
||||
sprintf(fileNameLocal, "%s/%s",REPO_LOCAL,tmpCnt_l->value->nameid);
|
||||
|
||||
Reference in New Issue
Block a user