Added support for handling binary files.
The problem was I was using XDR strings for reading data, storing it
and transferring to the client from the server. But since this is no
better than null-terminated string, whenever data had \000 the data
used to become corrupt from that point. So now I changed all data to
be integer arrays so there is no question of corruption.
# Makefile: To build client and server for ftp implemented using RPC
all: stubs ftp_xdr.o server client
debug: stubs ftp_xdr.o ftps-dbg ftpc-dbg
server: ftps
server-dbg: ftps-dbg
client: ftpc
client-dbg: ftpc-dbg
ftps: ftp_svc.c ftps.c ftp_xdr.o ftp.h
gcc ftp_svc.c ftps.c ftp_xdr.o -o ftps
ftps-dbg: ftp_svc.c ftps.c ftp_xdr.o ftp.h
gcc ftp_svc.c ftps.c ftp_xdr.o -o ftps-dbg -g
ftpc: ftpc.c ftp_clnt.c ftp_xdr.o ftp.h
gcc ftpc.c ftp_clnt.c ftp_xdr.o -o ftpc
ftpc-dbg: ftpc.c ftp_clnt.c ftp_xdr.o ftp.h
gcc ftpc.c ftp_clnt.c ftp_xdr.o -o ftpc-dbg -g
ftp_xdr.o: ftp_xdr.c ftp.h
gcc -c ftp_xdr.c
stubs: ftp.x
rpcgen ftp.x
clean:
rm ftp_xdr.o ftpc ftps ftp_clnt.c ftp_svc.c ftp_xdr.c ftp.h ftps-dbg ftpc-dbg