Solved

Best way to get files from Unix/Linux share to Windows Server (Programatically within .Net application)

Posted on 2009-04-07
4
647 Views
Last Modified: 2013-12-17
Hi all,
Thanks for looking this post. My question is:
What's the Best/Reliable/Easy way to get files from Unix/Linux share to Windows(Programatically within .Net application)? I need to create an application/service that runs continuously to watch for that unix/linux share and get files. Currently, I have a .net code that maps Unix/Linus share as a network drive on Windows Server with userid impersonation and gets files on Windows Server and then disconnect mapped share.  That works fine. But, it has overheads of mapping network drive at runtime and then disconnect after it's done.
Is there any better way to do this Programatically within .Net application?
0
Comment
Question by:chinawal
  • 2
4 Comments
 
LVL 15

Assisted Solution

by:spprivate
spprivate earned 75 total points
Comment Utility
another way to do is (what we did) was to use ftp.So set up the share as ftp and download from ftp.
Even couple of MSDN sites also suggest to use ftpwebrequest
0
 
LVL 5

Author Comment

by:chinawal
Comment Utility
Thanks for advice. Unfortunately, the unix/linux box is out of my control. I may not be able to get it setup as FTP.
0
 
LVL 2

Accepted Solution

by:
raffraffraff earned 175 total points
Comment Utility
I think what you're asking is "Does .NET have any built-in functionality for polling Unix boxes that don't have SAMBA running on them?" I doubt it, but I'm ready to be proven wrong. Microsoft released Windows Services For Unix for free, but I'm not sure if any of it is exposed through the .NET framework.

You could use SFU or GnuWin32 to speak natively to the Unix box, but you would have to run their .exe files the same way you'd use any DOS-like .exe file in .NET. It may be a little clunky, but essentially, armed with an ssh account on the Unix box, you could run an 'expect' script to list the remote directory contents and based on the results, you could run a second expect script to copy the files to the WIndows side.

If this sounds like it might work, let me know and I'll elaborate if I can. Otherwise, couldn't you just leave the Unix share mapped on the Windows box to avoid the overhead of mapping / disconnecting each time?
0
 
LVL 5

Author Comment

by:chinawal
Comment Utility
I think, that share is a SAMABA share. I am not 100% sure. Since I am able to access it from Windows, doesn't it indicate that it has Samba and I read somewhere that it's a samba? (this server is out of my control).
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
WPF issue with Trigger 2 65
Need more details 5 82
Microsoft Access 2010 Question 2 39
Is IHttpActionResult a promise pattern? 2 32
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now