Solved

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

Posted on 2009-04-07
4
654 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
ID: 24092770
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
ID: 24097151
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
ID: 24098726
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
ID: 24099387
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let’s list some of the technologies that enable smooth teleworking. 
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

808 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