Jump to content

Random file name, copy verification server and if the file exists


Go to solution Solved by jdelaney,

Recommended Posts

Hello, and every week I have a new question. 
 
I mention them already done the search before and did not specifically find what I need. obviously i know, filecopy, dircopy, fileexist, etc...
 
is simple but still do not understand how to implement it. 
 
Let's begin: 
 
I generate a local folder several txt files with a random name, and leaves the result that takes the date and exact time with their seconds, eg. 07162014112824.txt 
 
I need to copy these files which do not know the exact name so I explained before and move them to a folder on a server and at the same time check that folder if the file exists or has already copied to the server and if you delete it locally there is no copy (Do not forget I do not know the file name only extensions. txt) must take into account that is by wifi and there is a possibility of interruption or packet loss for a few minutes on the net, when I return make the request for a copy verify and copy. 
 
Got that? 
 
's that simple but not how to do that routine. 
 
Thank you as always for your great support. 
 
Christian
Link to comment
Share on other sites

  • Moderators

What have you tried on your own, how are you generating the folder and the files? Is the folder's name static?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

What have you tried on your own, how are you generating the folder and the files? Is the folder's name static?

 

Yes  the Local Folder it´s Static and the server folder too.

local folder: c:anyname

remote folder: anyname

only generate random files.txt with the date and time.

a hundred of files...

file1=07162014112824.txt 

file2=07162014112843.txt 

file3=07162014113314.txt 

i must check if file1 it´s not in the server folder copy and remove from local folder if not wait to the connection wifi its up again and copy the files to the folder server and remove locally, every 2 or 3 seconds i must send the files if the connection wifi its up or wait to reconnect and then send the files.

Link to comment
Share on other sites

 

Use:

_FileListToArray

 

Perfect you open my mind.

this its an sample becaus emy code it´s too long. and i only need help in this situation for the moment.

both path are local because it´s only for test. i only need to change the root path for the maped server.

#include <File.au3>
#include <Array.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    While 1
    ; List all the files and folders in the desktop directory using the default parameters.
    Local $aFileList = _FileListToArray("C:\copiar", "*.txt")
    If @error = 1 Then
        MsgBox($MB_SYSTEMMODAL, "", "Path was invalid.")
        Exit
    EndIf
    If @error = 4 Then
        MsgBox($MB_SYSTEMMODAL, "", "No file(s) were found.")
        Exit
    EndIf
    ; Display the results returned by _FileListToArray.

     For $vElement In $aFileList
        FileMove("C:\copiar"&"\"&$vElement, "C:\copiar\copiar2\")
     Next

    WEnd
EndFunc   ;==>Example 
jdelaney 

Thank you very much for your help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...