/* mouvement de fichier entre la r‚f‚rence groupe et le r‚pertoire du programmeur */ #include #include #include #include #include "projet.h" #include "projetx.m" /* Fait une copie a partir de ucopy ou xcopy Utilise ucopy si la source et la destination sont sur un network et si ucopy existe. Retourne nombre de fichier copier si ok, -1 si erreur */ static int near copy ( const char *srcpath, const char *wild, const char *dstpath) { return file_copytree (srcpath,dstpath,wild); } #if 0 /* Copie une liste de wildcard Retourne -1 si erreur */ static int near copy_list ( const char *srcpath, const char *tb[], /* liste de wildcard termin‚ par un NULL */ int nbtb, const char *dstpath) { int i; int ret = 0; for (i=0;i < nbtb; i++){ #if 0 bcprintf (" copie %s/%s -> %s\r\n" ," copy %s/%s -> %s\r\n" ,srcpath,tb[i],dstpath); #endif ret = copy (srcpath,tb[i],dstpath); if (ret == -1){ xconf_error (MSG_R(E_COPY),srcpath,tb[i],dstpath); break; } } return ret; } #endif /* Creation de la structure de r‚pertoire avant une copie. Retourne -1 si erreur, 0 si ok */ int prjopr_makedir ( const char *prjpath, const char *usrpath) { int ret; #if 0 bcprintf ("->Cr‚ation de la structure de r‚pertoire %s\r\n" ,"->Directory structure creation: %s\r\n" ,usrpath); #endif ret = dir_copystruct (prjpath,usrpath); if (ret == -1){ xconf_error (MSG_U(E_CREATSUB ,"Ne peut créer les sous répertoires de\n%s") ,usrpath); } return ret; } /* Copie les fichiers de base dans l'environnement du programmeur Retourne -1 si erreur, 0 si ok */ /* Copie un projet d'un r‚pertoire … un autre Retourne -1 si erreur, 0 si ok */ int prjopr_copie ( const char *source, const char *destination) { int ret = -1; if (dir_copystruct (source,destination)!=-1 && copy (source,WILD_ALLFILE,destination) !=-1) ret = 0; return (ret); } int prjopr_objdist ( const char *prjpath, const char *objpath) { int ret = -1; if (prjopr_makedir(prjpath,objpath)!=-1){ char *tb[200]; int nb = dir_getlistd (objpath,"*.*",100,tb,200); int i; ret = 0; for (i=0; i