Sign in to follow this  
Followers 0
FMS

copy map to another location

7 posts in this topic

Dear reader,

I recently made a simple script to copy files to another location for backup services.

While 1
    $search = FileFindFirstFile("C:\test\*.pdf")

    If $search = -1 Then
        sleep(60000)
    Else
        $file = FileFindNextFile($search)
        filemove("C:\test\" & $file,"Z:\test",8)
    EndIf

    FileClose($search)
WEnd

now there are not only pdf files in the dir "test" but more files (.exe , .bat etc)  and sub dir like C:testtest2

I would like to also copy the directory's to the other location but don't understand how....

Zould somebody please help me or point me in the wright direction :)

greez

FMS


as finishing touch god created the dutch

Share this post


Link to post
Share on other sites



If you're looking to copy the entire directory, look at DirCopy in the help file.

If you only want certain files, look at _FileListToArray and use the filter to grab only the files you want.


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

Share this post


Link to post
Share on other sites

thanks for the tip....

I looked in to it but,..

do you also know a way to check if there is a new file in the "sub dir" and iff so fire a dircopy command?

thanks in advanced


as finishing touch god created the dutch

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Just to clarify, are you asking how to monitor a directory and if a new file is found move just that file? Or move the whole directory? Or just the pdf files? Can you please be a bit more specific?

Edited by JLogan3o13

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

Share this post


Link to post
Share on other sites

yes i mean how to monitor a directory and if a new file is found move the whole directory :)


as finishing touch god created the dutch

Share this post


Link to post
Share on other sites

Rather than re-write something, I would suggest you take a look at this thread where Melba presents a solid example of monitoring a directory. I would also encourage you to think about keeping a running list of the files in the directory (written to a text file, kept in an array, etc.) so that you're only moving those files that have been added. This will cause a lot less overhead than moving the entire directory each time.

'?do=embed' frameborder='0' data-embedContent>>


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

Share this post


Link to post
Share on other sites

thnx JLogan i looked into it and just what i needed... (i think at the moment)

justy posted there a question for Melba  :)


as finishing touch god created the dutch

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