UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2005-07-29 07:52 AM

amartya_in
Member
Registered: 2005-06-07
Posts: 2

Re: Remote Directory browsing in UNIX/C

Good day to all of you member.I got some problem in program,I want to browse the directory of a remote system using Socket programming.Just to get the whole directory content through TCP data .
Explaining it,two system is there i will write two program to connect the 2 system using Socket.& i want to get the directory structure of /home/someusername from the client system.that data the server will send to client.
I know socket programming but do not have the idea of doing this thing & i need the code , if it is available in net. Looking for quick reply. Please help me.

Offline

#2 2005-07-29 01:03 PM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: Remote Directory browsing in UNIX/C

You need to make your own (or use an existing) protocol on top of TCP to achieve what you want. Sockets are just a way to pass along data between systems, what that data is and how it looks like doesn't matter, it only matters for your programs who need to work with that data. So the question is what exactly you want to do. Just a remote 'ls' and 'cd', or more?

As for existing code, it depends on what exactly you mean with "directory browsing". You could make something very simple that just does what you need, and nothing more, thus keeping it very simple. Or you could implement an existing protocol, like LDAP, FTP, NFS...

Offline

#3 2005-10-06 07:42 PM

ramchandar
Member
From: INDIA
Registered: 2004-11-14
Posts: 33

Re: Remote Directory browsing in UNIX/C

why dont u try with dirent structure in c ,also there are functions like opendir() ,readdir(),closedir() ...etc with this can do what u want and send these details to the client using your own message format

hope this will help u to get an idea....


RAMCHANDAR

[email][email protected][/email]

Offline

Board footer

Powered by FluxBB