Skip to content

Commit

Permalink
Wildcards prototype
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/node/svn/hts@15 cfcc7383-0204-4295-856a-6b29432e848c
  • Loading branch information
goran committed Jan 8, 2011
1 parent 96a89d7 commit 931b08c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion server.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ void sendFile(char* f, int connFd)
char sendBuffer[BUF];
FILE *file;
int leftBytes;
int iterations = 1;
int i;

//parsing given filename => wildcards
for(i = 0; i < strlen(f); i++) {
if( f[i] == '*') {
//calling function which returns a matrix (array[#files][0])
printf("\nSchternsche g'funde!\n");
break;
}
}

strcat(filename, dirname);
strcat(filename, "/");
Expand All @@ -200,6 +211,8 @@ void sendFile(char* f, int connFd)
}
else
{
//for-loop for implementation of wildcards acceptance
for(i = 0; i < iterations; i++) {
sizeOfFile = attribut.st_size;
sprintf(sendBuffer, "%ld", sizeOfFile);
writen(connFd, sendBuffer, BUF-1);
Expand All @@ -223,6 +236,7 @@ void sendFile(char* f, int connFd)
i++;
}
fclose(file);
}
}
}

Expand All @@ -245,4 +259,4 @@ ssize_t writen (int fd, const void *vptr, size_t n)
ptr += nwritten ;
} ;
return (n) ;
} ;
} ;

0 comments on commit 931b08c

Please sign in to comment.