/usr/share/doc/libfox-1.6-doc/html/filefuncs.html is in libfox-1.6-doc 1.6.50-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | <html>
<head>
<link rel="stylesheet" href="page.css" type="text/css">
<title>Documentation: File Manipulation</title>
</head>
<body bgcolor=#ffffff link=#990033 vlink=#990033 alink=#990033 text=#000000>
<!---- TOPIC TITLE WITH LOGO--->
<table border=0 cellpadding= cellspacing=2 width=100% ><tr><td><a href='http://www.fox-toolkit.org' target=_top><img src='art/foxlogo_small.jpg' border=0></a></td><td width=100% valign=bottom id="HEADLINE"><b>
Documentation: File Manipulation <A href='filefuncs.html' target="_top" align=left><font size=-2>[Remove Frame]</font></a>
<br><img src='art/line.gif' width=100% height=1></b></td></tr></table>
</p>
<!--- TOPIC TITLE WITH LOGO --->
<ul>
<p>Almost all applications will eventually be faced with the need to manipulate
file, and directories, and access the underlying operating system's file system.
In FOX, a large collection of
useful filename and directory name manipulation functions is provided with which you
can perform these tasks easily.
<br>Moreover, the FOX file manipulations are aware of platform specific
idiosyncracies, such as UNC under MS-Windows and escaping sequences under
UNIX.
</p>
</ul>
<!--- TOPIC TITLE -->
<p>
<table width=100% cellpadding=0 cellspacing=2><tr><td width=100% valign=bottom id=HEADLINE><b>
Finding Special Directories
<br><img src='art/line.gif' width=100% height=1></b></td></tr></table>
</p>
<!--- TOPIC TITLE -->
<ul>
<p>Certain directories in the file system are special, like the applications current working
directory, the users home directory, and so on. FOX supplies the following functions
for this purpose:</p>
<P><BR>FXString<B> getEnvironment</B>(const FXString& <B><I>name</I></B>)
<BLOCKQUOTE>This function obtains the environment variable <B><I>name</I></B>
from the environment. It returns the empty string if not found.</BLOCKQUOTE></p>
<P><BR>FXString<B> getHomeDirectory</B>()
<BLOCKQUOTE>Returns the current user's home directory.</BLOCKQUOTE>
<P><BR>FXString<B> getUserDirectory</B>(const FXString& <B><I>user</I></B>)
<BLOCKQUOTE>Returns the home directory of the named <B><I>user</I></B>, or the current
user's home directory if the parameter <B><I>user</I></B> is empty.</BLOCKQUOTE>
<P><BR>FXString<B> setCurrentDirectory</B>(const FXString& <B><I>path</I></B>)
<BLOCKQUOTE>Change the application's current working directory to <B><I>path</I></B></BLOCKQUOTE>
<P><BR>FXString<B> getCurrentDirectory</B>()
<BLOCKQUOTE>Returns the current working directory of the application.</BLOCKQUOTE>
<P><BR>FXString<B> setCurrentDrive</B>(const FXString& <B><I>prefix</I></B>)
<BLOCKQUOTE>Change the application's current drive letter to <B><I>prefix</I></B>,
where <B><I>prefix</I></B> is the drive letter, like "a:", "b:", and so on.
This function of course has no effect on UNIX systems.</BLOCKQUOTE>
<P><BR>FXString<B> getCurrentDrive</B>()
<BLOCKQUOTE>Returns the current drive letter of the application.
This function of course has no effect on UNIX systems.</BLOCKQUOTE>
<P><BR>FXString<B> getExecPath</B>()
<BLOCKQUOTE>Returns the path along which the systems shell usually locates executable
programs, or "$PATH". The returned path string is a sequence of directories separated
by <B><I>PATHLISTSEP</I></B>.</BLOCKQUOTE></p>
</ul>
<!--- TOPIC TITLE -->
<p>
<table width=100% cellpadding=0 cellspacing=2><tr><td width=100% valign=bottom id=HEADLINE><b>
Filename Manipulation
<br><img src='art/line.gif' width=100% height=1></b></td></tr></table>
</p>
<!--- TOPIC TITLE -->
<ul>
<p>Manipulating filenames is done with the following functions:</p>
<P><BR>FXString<B> directory</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return the directory part of <B><I>file</I></B>.
Note that <B>directory</B>("/bla/bla/") yields "/bla/bla" and NOT "/bla".
However, <B>directory</B>("/bla/bla") yields "/bla" as we expect!</BLOCKQUOTE>
<P><BR>FXString<B> name</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return name and extension part of <B><I>file</I></B>.
Note that <B>name</B>("/bla/bla/") yields "" and NOT "bla".
However, <B>name</B>("/bla/bla") yields "bla" as we expect.</BLOCKQUOTE>
<P><BR>FXString<B> title</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return title part of <B><I>file</I></B>.
This is the name of the document with the directory part and the extension part
removed.</BLOCKQUOTE>
<P><BR>FXString<B> extension</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return extension part of <B><I>file</I></B>.</BLOCKQUOTE>
<P><BR>FXString<B> stripExtension</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Strip the extension part of <B><I>file</I></B>.</BLOCKQUOTE>
<P><BR>FXString<B> drive</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return the drive letter part of <B><I>file</I></B>.
Of course, on UNIX systems this will return the empty string.</BLOCKQUOTE>
<P><BR>FXString<B> expand</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Expand meta-characters in <B><I>file</I></B>.
On UNIX systems, "~" is expanded into the current user's home directory,
"~user" into the given user's home directory, via <B>getUserDirectory</B>().
Also, "$VARIABLE", "${VARIABLE}", or "$(VARIABLE)" will be expanded into the
environment variable VARIABLE, via <B>getEnvironment</B>().
On MS-Windows, environment variables of the form "%VARIABLE%" are expanded
similarly.</BLOCKQUOTE>
<P><BR>FXString<B> simplify</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return the simplest pathname representation of <B><I>file</I></B>.
The path will remain relative if it was relative, or absolute if it was absolute.
Also, a trailing "/" will be preserved as this is important in other functions.
For example, simplify("..//aaa/./bbb//../c/") yields "../aaa/c/".</BLOCKQUOTE>
<P><BR>FXString<B> absolute</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return the absolute path to the <B><I>file</I></B>,
given the current working directory and drive letter.</BLOCKQUOTE>
<P><BR>FXString<B> absolute</B>(const FXString& <B><I>base</I></B>,const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Build the absolute path to the <B><I>file</I></B>,
from the given <B><I>base</I></B> directory and <B><I>file</I></B>.</BLOCKQUOTE>
<P><BR>FXString<B> relative</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return the path to <B><I>file</I></B>, relative to the current working directory.</BLOCKQUOTE>
<P><BR>FXString<B> relative</B>(const FXString& <B><I>base</I></B>,const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return the path to <B><I>file</I></B>, relative to the directory <B><I>base</I></B>.</BLOCKQUOTE>
<P><BR>FXString<B> enquote</B>(const FXString& <B><I>file</I></B>,FXbool <B><I>forcequotes</I></B>=FALSE)
<BLOCKQUOTE>Enquote <B><I>file</I></B> to make safe for shell. Normally, quotes
are only generated when necessary, but if <B><I>forcequotes</I></B> is TRUE quotes are always generated
regarless of necessity.<br>
Files with special characters need to be quoted before they may be passed to bash, ksh, csh (UNIX)
or cmd (MS-Windows).</BLOCKQUOTE>
<P><BR>FXString<B> dequote</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Dequote <B><I>file</I></B> to yield the original again.</BLOCKQUOTE>
<P><BR>FXString<B> unique</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Generate unique filename of the form "pathnameXXX.ext", where
pathname.ext is the original input <B><I>file</I></B>, and XXX is a number,
possibly empty, that makes the file unique.</BLOCKQUOTE>
<P><BR>FXString<B> search</B>(const FXString& <B><I>pathlist</I></B>,const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Search <B><I>pathlist</I></B> for this <B><I>file</I></B>, return full path
name for first occurrence. The <B><I>pathlist</I></B> is a <B><I>PATHLISTSEP</I></B> separated
list of directories, such as returned by <B>getExecPath</B>.</BLOCKQUOTE>
<P><BR>FXString<B> upLevel</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return path to directory above input directory <B><I>file</I></B>.</BLOCKQUOTE></p>
</ul>
<!--- TOPIC TITLE -->
<p>
<table width=100% cellpadding=0 cellspacing=2><tr><td width=100% valign=bottom id=HEADLINE><b>
Obtaining information about files
<br><img src='art/line.gif' width=100% height=1></b></td></tr></table>
</p>
<!--- TOPIC TITLE -->
<ul>
<p>A number of functions are also available to obtain various kinds of information about files
or directories:</p>
<P><BR>FXbool<B> isAbsolute</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if <B><I>file</I></B> is an absolute pathname.</BLOCKQUOTE>
<P><BR>FXbool<B> isTopDirectory</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if input <B><I>file</I></B> is a top-level directory.</BLOCKQUOTE>
<P><BR>FXbool<B> isFile</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if input <B><I>file</I></B> is a file name.</BLOCKQUOTE>
<P><BR>FXbool<B> isLink</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if input <B><I>file</I></B> is a link.</BLOCKQUOTE>
<P><BR>FXbool<B> isDirectory</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if input <B><I>file</I></B> is a directory.</BLOCKQUOTE>
<P><BR>FXbool<B> isReadable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if input <B><I>file</I></B> is readable.</BLOCKQUOTE>
<P><BR>FXbool<B> isWritable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if input <B><I>file</I></B> is writable.</BLOCKQUOTE>
<P><BR>FXbool<B> isExecutable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if input <B><I>file</I></B> is executable.</BLOCKQUOTE>
<P><BR>FXbool<B> isOwnerReadWriteExecute</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if owner has read-write-execute permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isOwnerReadable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if owner has read permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isOwnerWritable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if owner has write permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isOwnerExecutable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if owner has execute permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isGroupReadWriteExecute</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if group has read-write-execute permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isGroupReadable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if group has read permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isGroupWritable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if group has write permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isGroupExecutable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if group has execute permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isOtherReadWriteExecute</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if others have read-write-execute permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isOtherReadable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if others have read permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isOtherWritable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if others have write permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isOtherExecutable</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if others have execute permissions.</BLOCKQUOTE>
<P><BR>FXbool<B> isSetUid</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if the <B><I>file</I></B> sets the user id on execution.</BLOCKQUOTE>
<P><BR>FXbool<B> isSetGid</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if the <B><I>file</I></B> sets the group id on execution.</BLOCKQUOTE>
<P><BR>FXbool<B> isSetSticky</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if the <B><I>file</I></B> has the sticky bit set.</BLOCKQUOTE>
<P><BR>FXString<B> owner</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return owner name of <B><I>file</I></B>, if available; otherwise "user".</BLOCKQUOTE>
<P><BR>FXString<B> group</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return group name of <B><I>file</I></B>, if available; otherwise "group".</BLOCKQUOTE>
<P><BR>unsigned long<B> size</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return size of <B><I>file</I></B> in bytes</BLOCKQUOTE>
<P><BR>FXTime<B> modified</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return last modified time of <B><I>file</I></B>.</BLOCKQUOTE>
<P><BR>FXTime<B> accessed</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return last accessed time of <B><I>file</I></B>.</BLOCKQUOTE>
<P><BR>FXTime<B> created</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return create-time of <B><I>file</I></B>.</BLOCKQUOTE>
<P><BR>FXTime<B> touched</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return touched time of <B><I>file</I></B>.</BLOCKQUOTE></p>
</ul>
<!--- TOPIC TITLE -->
<p>
<table width=100% cellpadding=0 cellspacing=2><tr><td width=100% valign=bottom id=HEADLINE><b>
Copying, Moving, Linking Files
<br><img src='art/line.gif' width=100% height=1></b></td></tr></table>
</p>
<!--- TOPIC TITLE -->
<ul>
<p>The following operations are available on files:</p>
<P><BR>FXbool<B> createDirectory</B>(const FXString& <B><I>path</I></B>,FXuint <B><I>mode</I></B>)
<BLOCKQUOTE>Create new directory <B><I>path</I></B>, with permissions set to <B><I>mode</I></B>.</BLOCKQUOTE>
<P><BR>FXbool<B> createFile</B>(const FXString& <B><I>file</I></B>,FXuint <B><I>mode</I></B>)
<BLOCKQUOTE>Create new empty <B><I>file</I></B>, with permissions set to <B><I>mode</I></B>.</BLOCKQUOTE>
<P><BR>FXbool<B> concatenate</B>(const FXString& <B><I>srcfile1</I></B>,const FXString& <B><I>srcfile2</I></B>,const FXString& <B><I>dstfile</I></B>,FXbool <B><I>overwrite</I></B>=FALSE)
<BLOCKQUOTE>Concatenate <B><I>srcfile1</I></B> and <B><I>srcfile2</I></B> to a <B><I>dstfile</I></B>.
If <B><I>overwrite</I></B> is true, then the operation fails if <B><I>dstfile</I></B> already exists.
<B><I>srcfile1</I></B> and <B><I>srcfile2</I></B> should not be the same as <B><I>dstfile</I></B>.</BLOCKQUOTE>
<P><BR>FXbool<B> remove</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Remove <B><I>file</I></B> or directory, recursively.</BLOCKQUOTE>
<P><BR>FXbool<B> copy</B>(const FXString& <B><I>srcfile</I></B>,const FXString& <B><I>dstfile</I></B>,FXbool <B><I>overwrite</I></B>=FALSE)
<BLOCKQUOTE>Copy <B><I>srcfile</I></B> to a <B><I>dstfile</I></B>, recursively if <B><I>srcfile</I></B>
is a directory.
If <B><I>overwrite</I></B> is true, then the operation fails if <B><I>dstfile</I></B> or a file inside <B><I>dstfile</I></B>
already exists.</BLOCKQUOTE>
<P><BR>FXbool<B> move</B>(const FXString& <B><I>srcfile</I></B>,const FXString& <B><I>dstfile</I></B>,FXbool <B><I>overwrite</I></B>=FALSE)
<BLOCKQUOTE>Move <B><I>srcfile</I></B> to a <B><I>dstfile</I></B>, recursively if <B><I>srcfile</I></B>
is a directory.
If <B><I>overwrite</I></B> is true, then the operation fails if <B><I>dstfile</I></B> or a file inside <B><I>dstfile</I></B>
already exists.
If <B><I>srcfile</I></B> and <B><I>dstfile</I></B> are on the same file system, the files are moved;
if <B><I>srcfile</I></B> and <B><I>dstfile</I></B> are on different file systems, the files are copied
and the original <B><I>srcfile</I></B> is removed only after all files have been copied successfully.</BLOCKQUOTE>
<P><BR>FXbool<B> link</B>(const FXString& <B><I>srcfile</I></B>,const FXString& <B><I>dstfile</I></B>,FXbool <B><I>overwrite</I></B>=FALSE)
<BLOCKQUOTE>Link <B><I>dstfile</I></B> to <B><I>srcfile</I></B>.
If <B><I>overwrite</I></B> is true, then the operation fails if <B><I>dstfile</I></B>already exists.
If <B><I>srcfile</I></B> and <B><I>dstfile</I></B> are on different filesystems, the operation will fail.
</BLOCKQUOTE>
<P><BR>FXbool<B> symlink</B>(const FXString& <B><I>srcfile</I></B>,const FXString& <B><I>dstfile</I></B>,FXbool <B><I>overwrite</I></B>=FALSE)
<BLOCKQUOTE>Make a symbolic link from <B><I>dstfile</I></B> to <B><I>srcfile</I></B>.
If <B><I>overwrite</I></B> is true, then the operation fails if <B><I>dstfile</I></B>already exists.
</BLOCKQUOTE>
<P><BR>FXString<B> symlink</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return the destination of the symlink <B><I>file</I></B>.
</BLOCKQUOTE></p>
</ul>
<!--- TOPIC TITLE -->
<p>
<table width=100% cellpadding=0 cellspacing=2><tr><td width=100% valign=bottom id=HEADLINE><b>
Other File Operations
<br><img src='art/line.gif' width=100% height=1></b></td></tr></table>
</p>
<!--- TOPIC TITLE -->
<ul>
<p>Finally, some operations which don't fit in any easy categories:</p>
<P><BR>FXbool<B> match</B>(const FXString& <B><I>pattern</I></B>,const FXString& <B><I>file</I></B>,FXuint <B><I>flags</I></B>=(FILEMATCH_NOESCAPE|FILEMATCH_FILE_NAME))
<BLOCKQUOTE>Perform wildcard match of <B><I>file</I></B> against the <B><I>pattern</I></B>.
The pattern may contain special wild-card characters:</p>
<p>
<TABLE>
<TR><TD>?</TD><TD>Matches single character.</TD></TR>
<TR><TD>*</TD><TD>Matches zero or more characters.</TD></TR>
<TR><TD>[abc]</TD><TD>Matches a single character, which must be a, b, or c.</TD></TR>
<TR><TD>[^abc]</TD><TD>Matches a single character, which must be anything other than a, b, or c.</TD></TR>
<TR><TD>[!abc]</TD><TD>Ditto.</TD></TR>
<TR><TD>[a-zA-Z]</TD><TD>Matches single character, which must be one of a-z or A-Z.</TD></TR>
<TR><TD>[^a-zA-Z]</TD><TD>Matches single character, which must be anything other than a-z or A-Z.</TD></TR>
<TR><TD>[!a-zA-Z]</TD><TD>Ditto.</TD></TR>
<TR><TD>pat1|pat2</TD><TD>Matches either pat1 or pat2.</TD></TR>
<TR><TD>pat1,pat2</TD><TD>Ditto.</TD></TR>
<TR><TD>(pat1|pat2)</TD><TD>Matches either pat1 or pat2; patterns may be nested.</TD></TR>
<TR><TD>(pat1,pat2)</TD><TD>Ditto.</TD></TR>
</TABLE>
</p>
<p>Matching can be influenced using the flags as follows:</p>
<TABLE>
<TR><TD>FILEMATCH_FILE_NAME</TD><TD>No wildcard can ever match "/" (or "\","/" under Windows).</TD></TR>
<TR><TD>FILEMATCH_NOESCAPE</TD><TD>Backslashes don't quote special chars ("\" is treated as "\").</TD></TR>
<TR><TD>FILEMATCH_PERIOD</TD><TD>Leading "." is matched only explicitly (Useful to match hidden files on Unix).</TD></TR>
<TR><TD>FILEMATCH_LEADING_DIR</TD><TD>Ignore "/..." after a match.</TD></TR>
<TR><TD>FILEMATCH_CASEFOLD</TD><TD>Compare without regard to case.</TD></TR>
</TABLE>
<p>For example,</p>
<TABLE>
<TR><TD>*.cpp|*.cc|*.cxx|*.C</TD><TD>Matches some common extensions for C++ source files.</TD></TR>
<TR><TD>image.(bmp,gif,jpg)</TD><TD>Matches a file called image given as either bmp, gif, or jpg.</TD></TR>
<TR><TD>*.[^o]</TD><TD>Matches any file except object files.</TD></TR>
</TABLE>
</BLOCKQUOTE>
<P><BR>FXint<B> listFiles</B>(FXString*& <B><I>list</I></B>,const FXString& <B><I>path</I></B>,const FXString& <B><I>pattern</I></B>="*",FXuint <B><I>flags</I></B>=LIST_MATCHING_FILES|LIST_MATCHING_DIRS)
<BLOCKQUOTE>List files matching <B><I>pattern</I></B> in the directory given by <B><I>path</I></B>.
Returns the number of files in the string-array <B><I>list</I></B> which matched the pattern
or satisfied the <B><I>flag</I></B> conditions.
The flags parameter can be a combination of the following:</p>
<TABLE>
<TR><TD>LIST_MATCHING_FILES</TD><TD>Match files (default).</TD></TR>
<TR><TD>LIST_MATCHING_DIRS</TD><TD>Match directories (default).</TD></TR>
<TR><TD>LIST_NO_FILES</TD><TD>Do not match any files.</TD></TR>
<TR><TD>LIST_NO_DIRS</TD><TD>Do not match any directories.</TD></TR>
<TR><TD>LIST_ALL_FILES</TD><TD>Match all files.</TD></TR>
<TR><TD>LIST_ALL_DIRS</TD><TD>Match all directories.</TD></TR>
<TR><TD>LIST_HIDDEN_FILES</TD><TD>Match hidden files also.</TD></TR>
<TR><TD>LIST_HIDDEN_DIRS</TD><TD>Match hidden directories also.</TD></TR>
<TR><TD>LIST_NO_PARENT</TD><TD>Do not match "..".</TD></TR>
<TR><TD>LIST_CASEFOLD</TD><TD>Perform case insensitive matching.</TD></TR>
</TABLE>
</BLOCKQUOTE>
<P><BR>FXTime<B> now</B>()
<BLOCKQUOTE>Return current time.</BLOCKQUOTE>
<P><BR>FXString<B> time</B>(FXTime <B><I>filetime</I></B>)
<BLOCKQUOTE>Convert <B><I>filetime</I></B> to date-string.</BLOCKQUOTE>
<P><BR>FXString<B> time</B>(const FXchar *<B><I>format</I></B>,FXTime <B><I>filetime</I></B>)
<BLOCKQUOTE>Convert file time to date-string as per <B>strftime(3)</B>.
Format characters supported by most systems are:
<p>
<BLOCKQUOTE>%a %A %b %B %c %d %H %I %j %m %M %p %S %U %w %W %x %X %y %Y %Z %%</BLOCKQUOTE>
<p>
Some systems support additional conversions.
</BLOCKQUOTE>
<P><BR>FXbool<B> info</B>(const FXString& <B><I>file</I></B>,struct stat& <B><I>info</I></B>)
<BLOCKQUOTE>Return <B><I>info</I></B> of <B><I>file</I></B> as reported by system stat(2) function.</BLOCKQUOTE>
<P><BR>FXbool<B> exists</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return true if <B><I>file</I></B> exists.</BLOCKQUOTE>
<P><BR>FXbool<B> identical</B>(const FXString& <B><I>file1</I></B>,const FXString& <B><I>file2</I></B>)
<BLOCKQUOTE>Return true if <B><I>file1</I></B> and <B><I>file2</I></B> are identical, i.e. refer to
the same inode.</BLOCKQUOTE>
<P><BR>FXuint<B> mode</B>(const FXString& <B><I>file</I></B>)
<BLOCKQUOTE>Return the permissions of <B><I>file</I></B>.</BLOCKQUOTE>
<P><BR>FXbool<B> mode</B>(const FXString& <B><I>file</I></B>,FXuint <B><I>mode</I></B>)
<BLOCKQUOTE>Change the permission of <B><I>file</I></B> to <B><I>mode</I></B>.</BLOCKQUOTE>
</p>
</ul>
<!--- COPYRIGHT -->
<p>
<table width=100% cellpadding=0 cellspacing=0><tr><td width=100% valign=top id=HEADLINE align=right>
<img src='art/line.gif' width=100% height=1><font size=-1>
Copyright © 1997-2005 Jeroen van der Zijp</font>
</td></tr></table>
</p>
<!--- COPYRIGHT -->
</body>
</html>
|