1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
<html>
<head>
<title>EAGLE Help: fileglob()</title>
</head>
<body bgcolor=white>
<font face=Helvetica,Arial>
<hr>
<i>EAGLE Help</i>
<h1><center>fileglob()</center></h1>
<hr>
<dl>
<dt>
<b>Function</b>
<dd>
Perform a directory search.
<p>
<dt>
<b>Syntax</b>
<dd>
<tt>int fileglob(string &array[], string pattern);</tt>
<p>
<dt>
<b>Returns</b>
<dd>
The <tt>fileglob</tt> function returns the number of entries copied into <tt>array</tt>.
<p>
<dt>
<b>Description</b>
<dd>
<tt>fileglob</tt> performs a directory search using <tt>pattern</tt>.
<p>
<tt>pattern</tt> may contain <tt>'*'</tt> and <tt>'?'</tt> as wildcard characters.
If <tt>pattern</tt> ends with a <tt>'/'</tt>, the contents of the given directory will be returned.
<p>
Names in the resulting <tt>array</tt> that end with a <tt>'/'</tt> are directory names.
<p>
The <tt>array</tt> is sorted alphabetically, with the directories coming first.
<p>
The special entries <tt>'.'</tt> and <tt>'..'</tt> (for the current and parent directories)
are never returned in the <tt>array</tt>.
<p>
If <tt>pattern</tt> doesn't match, or if you don't have permission to search the given
directory, the resulting <tt>array</tt> will be empty.
</dl>
<b>See also</b> <a href=285.htm>dlgFileOpen()</a>,
<a href=285.htm>dlgFileSave()</a>
<p>
<b>Note for Windows users</b>
<p>
The directory delimiter in the <tt>array</tt> is always a <b>forward slash</b>.
This makes sure User Language Programs will work platform independently.
In the <tt>pattern</tt> the <b>backslash</b> (<tt>'\'</tt>) is also treated
as directory delimiter.
<p>
Sorting filenames under Windows is done case insensitively.
<p>
<b>Example</b>
<pre>
string a[];
int n = fileglob(a, "*.brd");
</pre>
<hr>
<table width=100% cellspacing=0 border=0><tr><td align=left><font face=Helvetica,Arial>
<a href=index.htm>Index</a>
</font></td><td align=right><font face=Helvetica,Arial size=-1>
<i>Copyright © 2005 CadSoft Computer GmbH</i>
</font></td></tr></table>
<hr>
</font>
</body>
</html>
|