Back to UNIX page

Directory listing server

Client and server communicate over tcp connection. Client sends requests as strings of maximum size 256 containing paths to directories. In response server sends number of objects contained in the requested directory on the server. If path is invalid or points something else than directory, server returns -1. Client can send many requests in single connection, each connection should be handled by separated process. Server program does not terminate, it can be killed instantly with SIGINT (C-c) at any moment

Client program reads directory names from stdin and sends them to server. Returned responses are displayed on the stdout. Program terminates on EOF on stdin (C-d). Client program can not fork child processes.

Server program takes port (p) as its sole parameter, clients takes network address (a) (as domain name) and port (p). If any of required parameters is not supplied, program should print usage information and exit.

Not counting number of entities in directory, returning always (-1) will be graded -4 points. Handling all connections in sequence in one process in server will be graded -4 points.

Task will be graded by Marcin Borkowski. Copy your solutions to /home2/samba/borkowskim/unix/ .

Extra attention should be payed to:

Back to UNIX page