Is there a way for c# to signal a Linux box?

  • Thread starter Thread starter D
  • Start date Start date
D

D

I need to ftp a file over to linux and send some sort of message or signal
to process it. c++ to Linux via rpc was a thought but not sure how to do
that in c#.

Also something that's also going to 64 bit Linux would be preferable.

Thanks alot.
 
You could build a simple daemon process running on your Linux box that
regularly polls the FTP folder for new files, then when it finds one it
can process it.

Or maybe you could have a simple CGI web page on your Linux box., You
could pass a parameter to the page when the file is ready to process
using a .NET WebClient object.

HTH,

Chris
 
Chris Fulstow said:
You could build a simple daemon process running on your Linux box that
regularly polls the FTP folder for new files, then when it finds one it
can process it.

That was my first thought but then was reading more about what if it wakes
up during the file transfer and the file is still open. The files are tiny
and the chances are slim but given that chance a system will eventually find
it. Actually now that I think about it I recall working on a system (years
ago) that was using perl and I think the same question came up and the perl
developer said that perl had a built in thing that would prevent that. I'll
have to see if I can dig that stuff up.
Or maybe you could have a simple CGI web page on your Linux box., You
could pass a parameter to the page when the file is ready to process
using a .NET WebClient object.

HTH,

I like that idea because I would like to also give the ability to do the
same from a web page that a standard user would use.

Thanks.
 
D said:
I need to ftp a file over to linux and send some sort of message or signal
to process it. c++ to Linux via rpc was a thought but not sure how to do
that in c#.

Also something that's also going to 64 bit Linux would be preferable.
A message over a TCP socket would be pretty simple.
 
D said:
That was my first thought but then was reading more about what if it wakes
up during the file transfer and the file is still open. The files are tiny
and the chances are slim but given that chance a system will eventually find
it. Actually now that I think about it I recall working on a system (years
ago) that was using perl and I think the same question came up and the perl
developer said that perl had a built in thing that would prevent that. I'll
have to see if I can dig that stuff up.

Hi, all you would need to do on the Linux box would be to check to see
if you can get a exclusive file lock.
If you cannot get one you then the file is still being written to.

Otherwise a small TCP daemon would be easy as well.


Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top