SunQuest
           FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 15th, 2003, 04:05 PM
jwolfe jwolfe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 38 jwolfe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Trying to FTP file to and from a UNIX box.

What I need is a constant ftp connection while my program is called. Another program calls my program and I have to FTP a file for it. This other program can call mine 50 times for example, I have the code to connect and FTP what I need and close every time my program is called, but if it calls 50 times that is 50 connects and disconnects. Is there any way to open a connection with another program and utilize that connection for FTPing each time my program is called? Thanks

Reply With Quote
  #2  
Old August 15th, 2003, 06:05 PM
mitakeet's Avatar
mitakeet mitakeet is offline
Last Day: May 28, 2005
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 4,575 mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 8 h 5 m 34 sec
Reputation Power: 20
You need to learn IPC

Inter-Process Communication is needed for something like what you are looking for, such as servers that listen on ports for requests, then carry them out. You will need a program that stays in memory call to call and can deal with multiple simultaneous calls. This not a trivial exercise and there are many ways to approach it. You could, for instance, have your 'server' (i.e., FTP manager) look for a file in a particular directory with some sort of information, then act on that information and delete the file. This, of course, requires that the process that writes the files (the one requesting the FTP service) does not overwrite other requests by different programs. It is a challenge to get it to work well in a low demand environment and very tricky to get right in a high demand environment. I prefer the socket approach because the OS will handle a lot of the queueing of the connections and if you don't have too much demand (say no more often than it takes to actually transfer your FTP files) then you don't even need to open up the can of worms called threading. Unless you are really having performance issues, I suggest you worry about something else. If this is really an issue, I would devote a large part of my effort to 'emulating' the FTP requests and see if there wasn't a way arround the need for it in the first place.

Good Luck!
__________________

Left DevShed May 28, 2005. Reason: Unresponsive administrators.
Free code: http://sol-biotech.com/code/.
Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.

It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
--Me, I just made it up

The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
--George Bernard Shaw

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Trying to FTP file to and from a UNIX box.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway