views:

54

answers:

3

I need to Read files form Linux , copy them into the another computer(Windows operation) and even delete file in Linux. but I want do this with .net program.!!!

these file have a specific location. I need code sample or article for doing that.

A: 

There are plenty of ways to do this, most of which have nothing to do with writing code. The most obvious is to share the Linux files with the Windows machine using Samba.

Marcelo Cantos
That is however rather unsafe, specially if it comes down to user handling in any way... I do fear that someone could dare to share /etc over a samba share *shiver*
BeowulfOF
What do you mean? Sharing files over Samba is widely practiced and can be made as secure as you want.
Marcelo Cantos
thx for u help i should test that
Rev
@Marcelo: as stated above. it is no problem to share passive data over a samba share, but files that should be private to the system, or files that are used by the system or a deamon of the system should not be exposed over samba. Security is only a minor concern about this...
BeowulfOF
@BeowulfOF, what is so wrong with sharing system-accessed files over Samba? Of course you have to be careful about setting up principals and granting permissions, but this is fairly normal practice.
Marcelo Cantos
A: 

Use something that speaks a useful file transfer protocol.

Ignacio Vazquez-Abrams
+1  A: 

As stated before, there are several ways to do this:

Set up a samba share on the linux box, that lets you access the files from your windows box with your .NET programm. Beware of not to expose private files to the net (like /etc or /var). Additionaly do not expose actively used files since it will cause unexpected behaviour if your deamon tries to access a file, that your programm works on. Just access exported, passive data files over the net.

Use libraries for SSH with your programm to access the files on the linux box programmatically.

Set up a cron job on the linux box, that copies the files regularly to a share on your windows box to be processed over there.

Set up a deamon in mono/.NET that runs on the linux box and passes the files over an API to your windows client .NET app.

Write the whole programm in mono/.NET and let it compute on the linux box.

Just some approaches to a solution, just pick one that suits you.

BeowulfOF
thx for u help i should test those solutions
Rev
I would use a mono program on the linux box and a .NET/mono program on the other, then let them communicate/send instructions.
Callum Rogers