Jump to content
Sign in to follow this  
Noél Dubau

Copy directory / Copy all files of a directory

Recommended Posts

Noél Dubau    0

Hello,

I need to copy a directory and its content to an external drive. I've seen and experimented the CopyFile function of Scriptmaster. Two questions :



  1. Is there a way to adapt it to copy a directory by passing in src /Volumes/Data/Desktop/Xtine/for example ?
  2. If not is it possible to say copy all files (equivalent of use jokers *.*) ?

Thanks for your answers ?

Noël

Share this post


Link to post
Share on other sites
JLC    0

We are actually looking for same thing but we'd also like something that can compare the backup to the source (essentially looks at the backup folders and files and when there are changes in the source, update only what has changed - like a smart update backup function). Any thoughts?

Hello,

I need to copy a directory and its content to an external drive. I've seen and experimented the CopyFile function of Scriptmaster. Two questions :



  1. Is there a way to adapt it to copy a directory by passing in src /Volumes/Data/Desktop/Xtine/for example ?
  2. If not is it possible to say copy all files (equivalent of use jokers *.*) ?

Thanks for your answers ?

Noël

Share this post


Link to post
Share on other sites
Smef    14

Noel,

You can use a combination of the List All Files In Directory, List all Files Recursively, and Move or Rename File modules along with FileMaker scripting to do what you are looking for.

JLC,

There is not currently a module to do this that comes with scriptmaster. If you would like us to write an additional module or make a custom plugin for you to do this, please send an email to infobox@360works.com along with details about what you need it to do and we will send you a quote.

Share this post


Link to post
Share on other sites
Noél Dubau    0

Noel,

You can use a combination of the List All Files In Directory, List all Files Recursively, and Move or Rename File modules along with FileMaker scripting to do what you are looking for.

I'll try to understand and perhaps build he solution you describe... but I'm at a small level !

Noël

Share this post


Link to post
Share on other sites
Smef    14

JLC, I was wrong actually. There is a Get File Modification Date module which you could use for checking to see if a file has been modified since you last checked it.

Share this post


Link to post
Share on other sites
clemhoff    2

The lazy way ...

Commons-IO-2.0.1.Jar

// Usage : CopyDirectory ( fm_source ; fm_destination )

// 2011_04_10

// v1

// jar : Commons-IO-2.0.1.Jar @ http://commons.apache.org/io/



import org.apache.commons.io.FileUtils

 

source = new File( fm_source );

destination = new File( fm_destination );

try {

    FileUtils.copyDirectory( source , destination  )

    return 1

} catch (IOException e) {

    return e

}

  • Like 1

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  

×

Important Information

By using this site, you agree to our Terms of Use.