/* Usage lfn2gsiftp */ #include #include #include #include #define GSIFTP #ifdef GSIFTP #define PREFIX "gsiftp://www2.jldg.org/gfarm/public/ILDG" #endif #ifdef HTTP #define PREFIX "http://www2.jldg.org/public/ILDG" #endif void elem(n,Path,Value) int n ; char Path[], Value[] ; { int c=0,x ; for(x=0;x ...\n",argv[0]) ; exit(1) ; } while (argc >1) { lfn = argv[1] ; if(strncmp(lfn,"lfn://",6)!=0) exit(1) ; elem(2,lfn,RGrid) ; if(strcmp(RGrid,"JLDG")!=0) exit(1) ; elem(3,lfn,Collab) ; elem(4,lfn,Project) ; elem(5,lfn,Base) ; strcpy(fname,PREFIX) ; append(fname,RGrid) ; append(fname,Collab) ; if(strcmp(Collab,"CP-PACS")==0) { if(strcmp(Project,"RCNF2")!=0) exit(1) ; edcppacs(fname,Project,Base) ; } else if(strcmp(Collab,"CP-PACS+JLQCD")==0) { if(strcmp(Project,"RCNF2+1")!=0) exit(1) ; edcpjlqcd(fname,Project,Base) ; } else if(strcmp(Collab,"PACS-CS")==0) { if(strcmp(Project,"RCNF2+1")!=0) exit(1) ; edpacscs(fname,Project,Base) ; } else if(strcmp(Collab,"JLQCD")==0) { if(strcmp(Project,"RgOvrNF2")!=0) exit(1) ; edjlqcd(fname,Project,Base) ; } else if(strcmp(Collab,"PACS-Collab")==0) { if(strcmp(Project,"RFCNF2p1")!=0) exit(1) ; edpacscs(fname,Project,Base) ; } else { exit(1) ; } printf("%s\n",fname) ; argv++ ; argc-- ; } }