[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Get/Put file To/From FTP server

Posted on 2004-09-21
5
Medium Priority
?
277 Views
Last Modified: 2010-05-02
Dear All,

I have two windwo applications A & B running on different PCs.

Application A: put a file to FTP server.
Application B: get this file FTP server.

How can I prevent Application B to get a file which is being uploaded to FTP server by Application A?

I think uploading a dummy file may be useful. Any good idea?

Thanks!
0
Comment
Question by:cplau
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:cplau
ID: 12111959
In getting a file, can I check this file is being modified by someone else?
0
 
LVL 4

Accepted Solution

by:
Glowman earned 500 total points
ID: 12112058
Cplau,
What I do is do a loose loop checking file size every few seconds depending on the connection rate use InternetFindNextFile to loop through the files in the FTP directory, and then using the WIN32_FIND_DATA to determine if the nFileSizeLow has changed, if it hasn't after a try or two the file up there is done being uploaded.  There must be a way to tell if the file is in a change state but I couldn't figure it out so I did it this way.  Got more code if you want it.
G
0
 
LVL 5

Expert Comment

by:abith
ID: 12112314
hi
there is a one way.  keep a index file in which weather the new has been upload completely or not.

Assume that if the A application is sending the file before sending the file create a file in the A server and set a flag to 0.  after completion set the flag to 1.

And b applicaiton can open the application and check the status.  and if the get is done the line can be deleted.

Else you have to go for the port connection method,

Regards
Abith
0
 
LVL 14

Expert Comment

by:aelatik
ID: 12112605
You could PUT the file starting with a special character like "~FILENAME.BIN".
When finished rename the file to "FILENAME.BIN"

And in your GET program don't dowload files starting with "~"
0
 
LVL 14

Expert Comment

by:aelatik
ID: 12112650
Or in your GET program, do a rename test before downloading to test if the file is in use. for example :

RENAME FILENAME.EXE TESTFILENAME.EXE
 ' Check if error occurs, if not RENAME it back and dowload
RENAME TESTFILENAME.EXE FILENAME.EXE
GET FILENAME.EXE C:\FILENAME.EXE
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 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