Sign in to follow this  
Followers 0
boniakowski

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

6 posts in this topic

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

Share this post


Link to post
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?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Perhaps you can show us your script. It will be easier for others to advise you onward.

Share this post


Link to post
Share on other sites

 

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0