root/MGET/Branches/Jason/PythonPackage/dist/TracOnlineDocumentation/Documentation/ArcGISReference/File.FindAndCopy.html @ 376

Revision 376, 12.5 KB (checked in by jjr8, 4 years ago)

Fixed/implemented:

* #332: SIR file conversion tools should use WGS-72 datum for Lambert projections, and NSIDC's datum for polar stereographic projections
* Bugs in the previous revision related to pre-install scripts.

If this passes additional testing, it will be merged with the Trunk and released as MGET 0.7a12.

Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="81help.css?format=raw" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Find and Copy Files</title></head><body><table style="margin-top:-1em; margin-bottom:0; padding:0; margin-left:-1em"><tr><td style="background:white"><img width="875" height="70" alt="ArcToolbox banner" src="AHBanner_ArcToolbox.gif?format=raw" /></td></tr></table><h1>Find and Copy Files</h1><p></p><p>Finds and copies files in a directory.</p><br /><p><h2><img width="11" height="11" border="0" src="sm_arrow_down.gif?format=raw" /> Command line syntax</h2></p><div Class="expand" id="id103145">FileFindAndCopy_GeoEco &lt;inputDirectory&gt; &lt;outputDirectory&gt; {wildcard} {searchTree} {minSize} {maxSize} {minDateCreated} {maxDateCreated} {minDateModified} {maxDateModified} {destinationFilePythonExpression} {modulesToImport;modulesToImport...} {skipExisting} <br /><br /><b>Parameters</b><br /><table width="100%" border="0" cellpadding="5"><tbody><tr><th width="40%"><b>Expression</b></th><th width="60%"><b>Explanation</b></th></tr><tr><td class="info">&lt;inputDirectory&gt;</td><td class="info" align="left"><p>Directory to search.</p></td></tr><tr><td class="info">&lt;outputDirectory&gt;</td><td class="info" align="left"><p>Directory to receive copies of the files.</p></td></tr><tr><td class="info">{wildcard}</td><td class="info" align="left"><p>UNIX-style "glob" wildcard expression specifying the pathnames to
4find.</p><p>The glob syntax supports the following patterns:</p><ul><li><p>? - matches any single character</p></li></ul><ul><li><p>* - matches zero or more characters</p></li></ul><ul><li><p>[seq] - matches any single character in <i>seq</i></p></li></ul><ul><li><p>[!seq] - matches any single character not in <i>seq</i></p></li></ul><p><i>seq</i> is one or more characters, such as abc. You may specify
5character ranges using a dash. For example, a-z0-9 specifies all of
6the characters in the English alphabet and the decimal digits 0
7through 9.</p><p>You may specify subdirectories in the glob expression. For example,
8the expression cruise*/sst* will find all paths beginning with sst
9that are contained in directories beginning with cruise.</p><p>The operating system determines whether / or \ is used as the
10directory separator. On Windows, both will work. On most flavors of
11UNIX, / must be used.</p><p>The operating system determines if matching is case sensitive. On
12Windows, matching is case-insensitive. On most flavors of UNIX,
13matching is case-sensitive.</p></td></tr><tr><td class="info">{searchTree}</td><td class="info" align="left"><p>If True, subdirectories will be searched.</p></td></tr><tr><td class="info">{minSize}</td><td class="info" align="left"><p>Minimum size, in bytes, of files to find. If provided, only files
14that are this size or larger will be found.</p></td></tr><tr><td class="info">{maxSize}</td><td class="info" align="left"><p>Maximum size, in bytes, of files to find. If provided, only files
15that are this size or smaller will be found.</p></td></tr><tr><td class="info">{minDateCreated}</td><td class="info" align="left"><p>Minimum creation date, in the local time zone, of the files to
16find, as reported by the operating system. If provided, only files
17that were created on or after this date will be found. You may provide
18a date with or without a time. If you do not provide a time, it is
19assumed to be midnight.</p></td></tr><tr><td class="info">{maxDateCreated}</td><td class="info" align="left"><p>Maximum creation date, in the local time zone, of the files to
20find, as reported by the operating system. If provided, only files
21that were created on or before this date will be found. You may
22provide a date with or without a time. If you do not provide a time,
23it is assumed to be midnight.</p></td></tr><tr><td class="info">{minDateModified}</td><td class="info" align="left"><p>Minimum modification date, in the local time zone, of the files to
24find, as reported by the operating system. If provided, only files
25that were modified on or after this date will be found. You may
26provide a date with or without a time. If you do not provide a time,
27it is assumed to be midnight.</p></td></tr><tr><td class="info">{maxDateModified}</td><td class="info" align="left"><p>Maximum modification date, in the local time zone, of the files to
28find, as reported by the operating system. If provided, only files
29that were modified on or before this date will be found. You may
30provide a date with or without a time. If you do not provide a time,
31it is assumed to be midnight.</p></td></tr><tr><td class="info">{destinationFilePythonExpression}</td><td class="info" align="left"><p>Python expression used to calculate the absolute path of the
32destination file. The expression may be any Python statement
33appropriate for passing to the eval function and must return a Unicode
34string. The expression may reference the following variables:</p><ul><li><p>directoryToSearch - the value provided for the directory to search
35parameter</p></li></ul><ul><li><p>destinationDirectory - the value provided for the destination
36directory parameter</p></li></ul><ul><li><p>sourceFile - the absolute path of the source file</p></li></ul><p>The default expression:</p><dl><dt></dt><dd><pre>os.path.join(destinationDirectory, sourceFile[len(directoryToSearch)+1:])</pre></dd></dl><p>stores the file in the destination directory at the same relative
37location as it appears in the directory to search. The destination
38path is calculated by stripping the directory to search from the
39source path and replacing it with the destination directory.</p><p>For more information on Python syntax, please see the <a href="http://www.python.org/doc/">Python
40documentation</a>.</p></td></tr><tr><td class="info">{modulesToImport;modulesToImport...}</td><td class="info" align="left"><p>Python modules to import prior to evaluating the expression. If
41you need to access Python functions or classes that are provided by a
42module rather than being built-in to the interpreter, list the module
43here. For example, to be able to use the datetime class in your
44expression, list the datetime module here. In your expression, you
45must refer to the class using its fully-qualified name,
46datetime.datetime.</p></td></tr><tr><td class="info">{skipExisting}</td><td class="info" align="left"><p>If True, copying will be skipped for destination files that already exist.</p></td></tr></tbody></table></div><p><h2><img width="11" height="11" border="0" src="sm_arrow_down.gif?format=raw" /> Scripting syntax</h2></p><div Class="expand" id="TEST">FileFindAndCopy_GeoEco (inputDirectory, outputDirectory, wildcard, searchTree, minSize, maxSize, minDateCreated, maxDateCreated, minDateModified, maxDateModified, destinationFilePythonExpression, modulesToImport, skipExisting) <br /><br /><b>Parameters</b><br /><table width="100%" border="0" cellpadding="5"><tbody><tr><th width="40%"><b>Expression</b></th><th width="60%"><b>Explanation</b></th></tr><tr><td class="info">Directory to search (Required) </td><td class="info" align="left"><p>Directory to search.</p></td></tr><tr><td class="info">Destination directory (Required) </td><td class="info" align="left"><p>Directory to receive copies of the files.</p></td></tr><tr><td class="info">Wildcard expression (Optional) </td><td class="info" align="left"><p>UNIX-style "glob" wildcard expression specifying the pathnames to
47find.</p><p>The glob syntax supports the following patterns:</p><ul><li><p>? - matches any single character</p></li></ul><ul><li><p>* - matches zero or more characters</p></li></ul><ul><li><p>[seq] - matches any single character in <i>seq</i></p></li></ul><ul><li><p>[!seq] - matches any single character not in <i>seq</i></p></li></ul><p><i>seq</i> is one or more characters, such as abc. You may specify
48character ranges using a dash. For example, a-z0-9 specifies all of
49the characters in the English alphabet and the decimal digits 0
50through 9.</p><p>You may specify subdirectories in the glob expression. For example,
51the expression cruise*/sst* will find all paths beginning with sst
52that are contained in directories beginning with cruise.</p><p>The operating system determines whether / or \ is used as the
53directory separator. On Windows, both will work. On most flavors of
54UNIX, / must be used.</p><p>The operating system determines if matching is case sensitive. On
55Windows, matching is case-insensitive. On most flavors of UNIX,
56matching is case-sensitive.</p></td></tr><tr><td class="info">Search directory tree (Optional) </td><td class="info" align="left"><p>If True, subdirectories will be searched.</p></td></tr><tr><td class="info">Minimum size (Optional) </td><td class="info" align="left"><p>Minimum size, in bytes, of files to find. If provided, only files
57that are this size or larger will be found.</p></td></tr><tr><td class="info">Maximum size (Optional) </td><td class="info" align="left"><p>Maximum size, in bytes, of files to find. If provided, only files
58that are this size or smaller will be found.</p></td></tr><tr><td class="info">Minimum creation date (Optional) </td><td class="info" align="left"><p>Minimum creation date, in the local time zone, of the files to
59find, as reported by the operating system. If provided, only files
60that were created on or after this date will be found. You may provide
61a date with or without a time. If you do not provide a time, it is
62assumed to be midnight.</p></td></tr><tr><td class="info">Maximum creation date (Optional) </td><td class="info" align="left"><p>Maximum creation date, in the local time zone, of the files to
63find, as reported by the operating system. If provided, only files
64that were created on or before this date will be found. You may
65provide a date with or without a time. If you do not provide a time,
66it is assumed to be midnight.</p></td></tr><tr><td class="info">Minimum modification date (Optional) </td><td class="info" align="left"><p>Minimum modification date, in the local time zone, of the files to
67find, as reported by the operating system. If provided, only files
68that were modified on or after this date will be found. You may
69provide a date with or without a time. If you do not provide a time,
70it is assumed to be midnight.</p></td></tr><tr><td class="info">Maximum modification date (Optional) </td><td class="info" align="left"><p>Maximum modification date, in the local time zone, of the files to
71find, as reported by the operating system. If provided, only files
72that were modified on or before this date will be found. You may
73provide a date with or without a time. If you do not provide a time,
74it is assumed to be midnight.</p></td></tr><tr><td class="info">Destination file Python expression (Optional) </td><td class="info" align="left"><p>Python expression used to calculate the absolute path of the
75destination file. The expression may be any Python statement
76appropriate for passing to the eval function and must return a Unicode
77string. The expression may reference the following variables:</p><ul><li><p>directoryToSearch - the value provided for the directory to search
78parameter</p></li></ul><ul><li><p>destinationDirectory - the value provided for the destination
79directory parameter</p></li></ul><ul><li><p>sourceFile - the absolute path of the source file</p></li></ul><p>The default expression:</p><dl><dt></dt><dd><pre>os.path.join(destinationDirectory, sourceFile[len(directoryToSearch)+1:])</pre></dd></dl><p>stores the file in the destination directory at the same relative
80location as it appears in the directory to search. The destination
81path is calculated by stripping the directory to search from the
82source path and replacing it with the destination directory.</p><p>For more information on Python syntax, please see the <a href="http://www.python.org/doc/">Python
83documentation</a>.</p></td></tr><tr><td class="info">Python modules to import (Optional) </td><td class="info" align="left"><p>Python modules to import prior to evaluating the expression. If
84you need to access Python functions or classes that are provided by a
85module rather than being built-in to the interpreter, list the module
86here. For example, to be able to use the datetime class in your
87expression, list the datetime module here. In your expression, you
88must refer to the class using its fully-qualified name,
89datetime.datetime.</p></td></tr><tr><td class="info">Skip existing outputs (Optional) </td><td class="info" align="left"><p>If True, copying will be skipped for destination files that already exist.</p></td></tr></tbody></table></div></body></html>
Note: See TracBrowser for help on using the browser.