i am trying to implement a network file system as part of an assign in C: the file system is on the server side and i have to send commands from the client side.
i have implemented my client and server. right now i am trying to implement a function called nfs_ls(char *filesys) which list all the files in file system filesys. this command will be sent from client to server side.
i am not posting my code mainly bcuz its alot of code and basically i wanted to ask if my approach for the function nfs_ls() makes sense or not. this is what i had in mind:
when the server receives the command, it gets a list of the files in the filesystem and saves all of them in one big buffer. i send the buffer back to client and on the client side, i tokenize the buffer with the '\n' and print each file
let me know what do you think and if there is a better solution, i wud like to hear that.
i apologize in advance if the info is not enough but i am happy to give more info if required!!