C client: all file functions