/usr/share/doc/racket/reference/Filesystem.html is in racket-doc 6.1-4.
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 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>15.2 Filesystem</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="extras.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span style="font-weight: bold">The Racket Reference</span></a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="model.html" class="tocviewlink" data-pltdoc="x">Language Model</a></td></tr><tr><td align="right">2 </td><td><a href="notation.html" class="tocviewlink" data-pltdoc="x">Notation for Documentation</a></td></tr><tr><td align="right">3 </td><td><a href="syntax.html" class="tocviewlink" data-pltdoc="x">Syntactic Forms</a></td></tr><tr><td align="right">4 </td><td><a href="data.html" class="tocviewlink" data-pltdoc="x">Datatypes</a></td></tr><tr><td align="right">5 </td><td><a href="structures.html" class="tocviewlink" data-pltdoc="x">Structures</a></td></tr><tr><td align="right">6 </td><td><a href="mzlib_class.html" class="tocviewlink" data-pltdoc="x">Classes and Objects</a></td></tr><tr><td align="right">7 </td><td><a href="mzlib_unit.html" class="tocviewlink" data-pltdoc="x">Units</a></td></tr><tr><td align="right">8 </td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">Contracts</a></td></tr><tr><td align="right">9 </td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">Pattern Matching</a></td></tr><tr><td align="right">10 </td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">Control Flow</a></td></tr><tr><td align="right">11 </td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">Concurrency and Parallelism</a></td></tr><tr><td align="right">12 </td><td><a href="Macros.html" class="tocviewlink" data-pltdoc="x">Macros</a></td></tr><tr><td align="right">13 </td><td><a href="input-and-output.html" class="tocviewlink" data-pltdoc="x">Input and Output</a></td></tr><tr><td align="right">14 </td><td><a href="security.html" class="tocviewlink" data-pltdoc="x">Reflection and Security</a></td></tr><tr><td align="right">15 </td><td><a href="os.html" class="tocviewselflink" data-pltdoc="x">Operating System</a></td></tr><tr><td align="right">16 </td><td><a href="memory.html" class="tocviewlink" data-pltdoc="x">Memory Management</a></td></tr><tr><td align="right">17 </td><td><a href="unsafe.html" class="tocviewlink" data-pltdoc="x">Unsafe Operations</a></td></tr><tr><td align="right">18 </td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">Running Racket</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">▼</a></td><td>15 </td><td><a href="os.html" class="tocviewlink" data-pltdoc="x">Operating System</a></td></tr></table><div class="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">15.1 </td><td><a href="pathutils.html" class="tocviewlink" data-pltdoc="x">Paths</a></td></tr><tr><td align="right">15.2 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Filesystem</a></td></tr><tr><td align="right">15.3 </td><td><a href="networking.html" class="tocviewlink" data-pltdoc="x">Networking</a></td></tr><tr><td align="right">15.4 </td><td><a href="subprocess.html" class="tocviewlink" data-pltdoc="x">Processes</a></td></tr><tr><td align="right">15.5 </td><td><a href="logging.html" class="tocviewlink" data-pltdoc="x">Logging</a></td></tr><tr><td align="right">15.6 </td><td><a href="time.html" class="tocviewlink" data-pltdoc="x">Time</a></td></tr><tr><td align="right">15.7 </td><td><a href="envvars.html" class="tocviewlink" data-pltdoc="x">Environment Variables</a></td></tr><tr><td align="right">15.8 </td><td><a href="runtime.html" class="tocviewlink" data-pltdoc="x">Environment and Runtime Information</a></td></tr><tr><td align="right">15.9 </td><td><a href="Command-Line_Parsing.html" class="tocviewlink" data-pltdoc="x">Command-<wbr></wbr>Line Parsing</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_2");">►</a></td><td>15.2 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Filesystem</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">15.2.1 </td><td><a href="#%28part._findpaths%29" class="tocviewlink" data-pltdoc="x">Locating Paths</a></td></tr><tr><td align="right">15.2.2 </td><td><a href="#%28part._fileutils%29" class="tocviewlink" data-pltdoc="x">Files</a></td></tr><tr><td align="right">15.2.3 </td><td><a href="#%28part._directories%29" class="tocviewlink" data-pltdoc="x">Directories</a></td></tr><tr><td align="right">15.2.4 </td><td><a href="#%28part._filesystem-change%29" class="tocviewlink" data-pltdoc="x">Detecting Filesystem Changes</a></td></tr><tr><td align="right">15.2.5 </td><td><a href="#%28part._runtime-path%29" class="tocviewlink" data-pltdoc="x">Declaring Paths Needed at Run Time</a></td></tr><tr><td align="right">15.2.6 </td><td><a href="#%28part._file-lib%29" class="tocviewlink" data-pltdoc="x">More File and Directory Utilities</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">15.2.1<tt> </tt></span><a href="#%28part._findpaths%29" class="tocsubseclink" data-pltdoc="x">Locating Paths</a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">find-<wbr></wbr>system-<wbr></wbr>path</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-list-string-~3epath-list%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">path-<wbr></wbr>list-<wbr></wbr>string-<wbr></wbr>>path-<wbr></wbr>list</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._find-executable-path%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">find-<wbr></wbr>executable-<wbr></wbr>path</span></span></a></td></tr><tr><td><span class="tocsublinknumber">15.2.2<tt> </tt></span><a href="#%28part._fileutils%29" class="tocsubseclink" data-pltdoc="x">Files</a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._file-exists~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>exists?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._link-exists~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">link-<wbr></wbr>exists?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._delete-file%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">delete-<wbr></wbr>file</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._rename-file-or-directory%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">rename-<wbr></wbr>file-<wbr></wbr>or-<wbr></wbr>directory</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-modify-seconds%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>or-<wbr></wbr>directory-<wbr></wbr>modify-<wbr></wbr>seconds</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-permissions%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>or-<wbr></wbr>directory-<wbr></wbr>permissions</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-identity%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>or-<wbr></wbr>directory-<wbr></wbr>identity</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._file-size%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>size</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._copy-file%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">copy-<wbr></wbr>file</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._make-file-or-directory-link%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>file-<wbr></wbr>or-<wbr></wbr>directory-<wbr></wbr>link</span></span></a></td></tr><tr><td><span class="tocsublinknumber">15.2.3<tt> </tt></span><a href="#%28part._directories%29" class="tocsubseclink" data-pltdoc="x">Directories</a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>directory</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory-for-user%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>directory-<wbr></wbr>for-<wbr></wbr>user</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-drive%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>drive</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._directory-exists~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">directory-<wbr></wbr>exists?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._make-directory%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>directory</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._delete-directory%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">delete-<wbr></wbr>directory</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._directory-list%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">directory-<wbr></wbr>list</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-root-list%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">filesystem-<wbr></wbr>root-<wbr></wbr>list</span></span></a></td></tr><tr><td><span class="tocsublinknumber">15.2.4<tt> </tt></span><a href="#%28part._filesystem-change%29" class="tocsubseclink" data-pltdoc="x">Detecting Filesystem Changes</a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">filesystem-<wbr></wbr>change-<wbr></wbr>evt?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">filesystem-<wbr></wbr>change-<wbr></wbr>evt</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt-cancel%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">filesystem-<wbr></wbr>change-<wbr></wbr>evt-<wbr></wbr>cancel</span></span></a></td></tr><tr><td><span class="tocsublinknumber">15.2.5<tt> </tt></span><a href="#%28part._runtime-path%29" class="tocsubseclink" data-pltdoc="x">Declaring Paths Needed at Run Time</a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">define-<wbr></wbr>runtime-<wbr></wbr>path</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-paths%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">define-<wbr></wbr>runtime-<wbr></wbr>paths</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path-list%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">define-<wbr></wbr>runtime-<wbr></wbr>path-<wbr></wbr>list</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-module-path-index%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">define-<wbr></wbr>runtime-<wbr></wbr>module-<wbr></wbr>path-<wbr></wbr>index</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._runtime-require%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">runtime-<wbr></wbr>require</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-module-path%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">define-<wbr></wbr>runtime-<wbr></wbr>module-<wbr></wbr>path</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._runtime-paths%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">runtime-<wbr></wbr>paths</span></span></a></td></tr><tr><td><span class="tocsublinknumber">15.2.6<tt> </tt></span><a href="#%28part._file-lib%29" class="tocsubseclink" data-pltdoc="x">More File and Directory Utilities</a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3estring%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>>string</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3ebytes%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>>bytes</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3evalue%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>>value</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3elist%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>>list</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3elines%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>>lines</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3ebytes-lines%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>>bytes-<wbr></wbr>lines</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._display-to-file%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">display-<wbr></wbr>to-<wbr></wbr>file</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._write-to-file%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">write-<wbr></wbr>to-<wbr></wbr>file</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._display-lines-to-file%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">display-<wbr></wbr>lines-<wbr></wbr>to-<wbr></wbr>file</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._copy-directory%2Ffiles%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">copy-<wbr></wbr>directory/<span class="mywbr"> </span>files</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._delete-directory%2Ffiles%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">delete-<wbr></wbr>directory/<span class="mywbr"> </span>files</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._find-files%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">find-<wbr></wbr>files</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._pathlist-closure%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">pathlist-<wbr></wbr>closure</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._fold-files%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">fold-<wbr></wbr>files</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-directory%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>directory*</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-temporary-file%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>temporary-<wbr></wbr>file</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-atomic-output-file%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">call-<wbr></wbr>with-<wbr></wbr>atomic-<wbr></wbr>output-<wbr></wbr>file</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._get-preference%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">get-<wbr></wbr>preference</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._put-preferences%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">put-<wbr></wbr>preferences</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._preferences-lock-file-mode%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">preferences-<wbr></wbr>lock-<wbr></wbr>file-<wbr></wbr>mode</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-handle-get-preference-locked%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>handle-<wbr></wbr>get-<wbr></wbr>preference-<wbr></wbr>locked</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-file-lock%2Ftimeout%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">call-<wbr></wbr>with-<wbr></wbr>file-<wbr></wbr>lock/<span class="mywbr"> </span>timeout</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-lock-file-name%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>lock-<wbr></wbr>file-<wbr></wbr>name</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._user-read-bit%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">user-<wbr></wbr>read-<wbr></wbr>bit</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._user-write-bit%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">user-<wbr></wbr>write-<wbr></wbr>bit</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._user-execute-bit%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">user-<wbr></wbr>execute-<wbr></wbr>bit</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._group-read-bit%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">group-<wbr></wbr>read-<wbr></wbr>bit</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._group-write-bit%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">group-<wbr></wbr>write-<wbr></wbr>bit</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._group-execute-bit%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">group-<wbr></wbr>execute-<wbr></wbr>bit</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._other-read-bit%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">other-<wbr></wbr>read-<wbr></wbr>bit</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._other-write-bit%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">other-<wbr></wbr>write-<wbr></wbr>bit</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._other-execute-bit%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">other-<wbr></wbr>execute-<wbr></wbr>bit</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="windowspaths.html" title="backward to "15.1.4 Windows Path Conventions"" data-pltdoc="x">← prev</a> <a href="os.html" title="up to "15 Operating System"" data-pltdoc="x">up</a> <a href="networking.html" title="forward to "15.3 Networking"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""Filesystem"">15.2<tt> </tt><a name="(part._.Filesystem)"></a>Filesystem</h4><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""findpaths"">15.2.1<tt> </tt><a name="(part._findpaths)"></a>Locating Paths</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._find-system-path))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValDef RktValLink" data-pltdoc="x">find-system-path</a></span></span><span class="hspace"> </span><span class="RktVar">kind</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">kind</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a machine-specific path for a standard type of path specified
by <span class="RktVar">kind</span>, which must be one of the following:</div></p><ul><li><p><a name="(idx._(gentag._272._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">home-dir</span> —<wbr></wbr> the current <a name="(tech._user's._home._directory)"></a><span style="font-style: italic">user’s home
directory</span>.</p><p>On all platforms, if the <a name="(idx._(gentag._273._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">PLTUSERHOME</span> environment
variable is defined as a <a href="Manipulating_Paths.html#%28tech._complete%29" class="techoutside" data-pltdoc="x"><span class="techinside">complete</span></a> path, then the path is used
as the user’s home directory.</p><p>On Unix and Mac OS X, when <span class="stt">PLTUSERHOME</span> does not apply,
the user’s home directory is determined by
expanding the path <span class="stt">"~"</span>, which is expanded by first checking
for a <a name="(idx._(gentag._274._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">HOME</span> environment variable. If none is defined,
the <a name="(idx._(gentag._275._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">USER</span> and <a name="(idx._(gentag._276._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">LOGNAME</span> environment
variables are consulted (in that order) to find a user name, and then
system files are consulted to locate the user’s home directory.</p><p>On Windows, when <span class="stt">PLTUSERHOME</span> does not apply,
the user’s home directory is the user-specific profile
directory as determined by the Windows registry. If the registry
cannot provide a directory for some reason, the value of the
<a name="(idx._(gentag._277._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">USERPROFILE</span> environment variable is used instead, as
long as it refers to a directory that exists. If <span class="stt">USERPROFILE</span>
also fails, the directory is the one specified by the
<a name="(idx._(gentag._278._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">HOMEDRIVE</span> and <a name="(idx._(gentag._279._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">HOMEPATH</span> environment
variables. If those environment variables are not defined, or if the
indicated directory still does not exist, the directory containing
the current executable is used as the home directory.</p></li><li><p><a name="(idx._(gentag._280._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">pref-dir</span> —<wbr></wbr> the standard directory for
storing the current user’s preferences. On Unix, the directory is
<span class="stt">".racket"</span> in the <a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s home directory</span></a>. On Windows,
it is <span class="stt">"Racket"</span> in the <a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s home directory</span></a> if
determined by <span class="stt">PLTUSERHOME</span>, otherwise in the user’s
application-data folder as specified by the Windows registry; the
application-data folder is usually <span class="stt">"Application Data"</span> in the
user’s profile directory. On Mac OS X, the preferences directory
is <span class="stt">"Library/Preferences"</span> in the
<a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s home directory</span></a>. The preferences directory might not exist.</p></li><li><p><a name="(idx._(gentag._281._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">pref-file</span> —<wbr></wbr> a file that contains a
symbol-keyed association list of preference values. The file’s
directory path always matches the result returned for
<span class="RktVal">'</span><span class="RktVal">pref-dir</span>. The file name is <span class="stt">"racket-prefs.rktd"</span> on Unix
and Windows, and it is <span class="stt">"org.racket-lang.prefs.rktd"</span> on Mac OS
X. The file’s directory might not exist. See also
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._get-preference%29%29" class="RktValLink" data-pltdoc="x">get-preference</a></span>.</p></li><li><p><a name="(idx._(gentag._282._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">temp-dir</span> —<wbr></wbr> the standard directory for
storing temporary files. On Unix and Mac OS X, this is the directory
specified by the <a name="(idx._(gentag._283._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">TMPDIR</span> environment variable, if it
is defined, otherwise it is the first path that exists among
<span class="stt">"/var/tmp"</span>, <span class="stt">"/usr/tmp"</span>, and <span class="stt">"/tmp"</span>. On
Windows, the result is the directory specified by the
<a name="(idx._(gentag._284._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">TMP</span> or <a name="(idx._(gentag._285._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">TEMP</span> environment variable,
if it is defined, otherwise it is the current directory.</p></li><li><p><a name="(idx._(gentag._286._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">init-dir</span> —<wbr></wbr> the directory containing the
initialization file used by the Racket executable.
It is the same as the <a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s home directory</span></a>.</p></li><li><p><a name="(idx._(gentag._287._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">init-file</span> —<wbr></wbr> the file loaded at start-up by
the Racket executable. The directory part of the
path is the same path as returned for <span class="RktVal">'</span><span class="RktVal">init-dir</span>. The file
name is platform-specific:</p><ul><li><p>Unix and Mac OS X: <a name="(idx._(gentag._288._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">".racketrc"</span></p></li><li><p>Windows: <a name="(idx._(gentag._289._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">"racketrc.rktl"</span></p></li></ul></li><li><p><a name="(idx._(gentag._290._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">config-dir</span> —<wbr></wbr> a directory for
the installation’s configuration. This directory is specified by the
<a name="(idx._(gentag._291._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">PLTCONFIGDIR</span> environment variable, and it can be
overridden by the <span class="nobreak"><span class="stt">--config</span></span> or <span class="nobreak"><span class="stt">-G</span></span> command-line flag. If no
environment variable or flag is specified, or if the value is not a
legal path name, then this directory defaults to an
<span class="stt">"etc"</span> directory relative to the current executable.
If the result of <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValLink" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">config-dir</span><span class="RktPn">)</span> is a
relative path, it is relative to the current executable.
The directory might not exist.</p></li><li><p><a name="(idx._(gentag._292._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">addon-dir</span> —<wbr></wbr> a directory for
user-specific Racket configuration, packages, and extension.
This directory is specified by the
<a name="(idx._(gentag._293._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">PLTADDONDIR</span> environment variable, and it can be
overridden by the <span class="nobreak"><span class="stt">--addon</span></span> or <span class="nobreak"><span class="stt">-A</span></span> command-line flag. If no
environment variable or flag is specified, or if the value is not a
legal path name, then this directory defaults to
<span class="stt">"Library/Racket"</span> in the <a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s home directory</span></a> on Mac
OS X and <span class="RktVal">'</span><span class="RktVal">pref-dir</span> otherwise. The directory might not
exist.</p></li><li><p><a name="(idx._(gentag._294._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">doc-dir</span> —<wbr></wbr> the standard directory for
storing the current user’s documents. On Unix, it’s
the <a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s home directory</span></a>. On Windows, it is the <a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s
home directory</span></a> if determined by <span class="stt">PLTUSERHOME</span>, otherwise it
is the user’s documents folder as specified by the Windows registry;
the documents folder is usually <span class="stt">"My Documents"</span> in the user’s
home directory. On Mac OS X, it’s the <span class="stt">"Documents"</span> directory
in the <a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s home directory</span></a>.</p></li><li><p><a name="(idx._(gentag._295._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">desk-dir</span> —<wbr></wbr> the directory for the current user’s
desktop. On Unix, it’s the <a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s home directory</span></a>. On
Windows, it is the <a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s home directory</span></a> if determined by
<span class="stt">PLTUSERHOME</span>, otherwise it is the user’s desktop folder as
specified by the Windows registry; the desktop folder is usually
<span class="stt">"Desktop"</span> in the user’s home directory. On Mac OS X, it is
<span class="stt">"Desktop"</span> in the <a href="#%28tech._user%27s._home._directory%29" class="techoutside" data-pltdoc="x"><span class="techinside">user’s home directory</span></a></p></li><li><p><a name="(idx._(gentag._296._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">sys-dir</span> —<wbr></wbr> the directory containing the
operating system for Windows. On Unix and Mac OS X, the
result is <span class="RktVal">"/"</span>.</p></li><li><p><a name="(idx._(gentag._297._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">exec-file</span> —<wbr></wbr> the path of the Racket
executable as provided by the operating system for the current
invocation. For some operating systems, the path can be relative.</p><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>For GRacket, the executable path is the name of a GRacket
executable.</p></blockquote></blockquote></blockquote></li><li><p><a name="(idx._(gentag._298._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">run-file</span> —<wbr></wbr> the path of the current
executable; this may be different from result for
<span class="RktVal">'</span><span class="RktVal">exec-file</span> because an alternate path was provided through a
<span class="nobreak"><span class="stt">--name</span></span> or <span class="nobreak"><span class="stt">-N</span></span> command-line flag to the Racket
(or GRacket) executable, or because an embedding executable
installed an alternate path. In particular a “launcher” script
created by <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=raco&rel=exe.html%23%2528def._%2528%2528lib._launcher%252Flauncher..rkt%2529._make-racket-launcher%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">make-racket-launcher</a></span> sets this path to the
script’s path.</p></li><li><p><a name="(idx._(gentag._299._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">collects-dir</span> —<wbr></wbr> a path to the main
collection of libraries (see <a href="collects.html" data-pltdoc="x">Libraries and Collections</a>). If this path is
relative, then it is relative to the executable as reported by
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValLink" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">exec-file</span><span class="RktPn">)</span>—<wbr></wbr>though the latter could be a
soft-link or relative to the user’s executable search path, so that
the two results should be combined with
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._find-executable-path%29%29" class="RktValLink" data-pltdoc="x">find-executable-path</a></span>. The <span class="RktVal">'</span><span class="RktVal">collects-dir</span> path is
normally embedded in the Racket executable, but it can be
overridden by the <span class="nobreak"><span class="stt">--collects</span></span> or <span class="nobreak"><span class="stt">-X</span></span> command-line flag.</p></li><li><p><a name="(idx._(gentag._300._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">orig-dir</span> —<wbr></wbr> the current directory at
start-up, which can be useful in converting a relative-path result
from <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValLink" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">exec-file</span><span class="RktPn">)</span> or
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValLink" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">run-file</span><span class="RktPn">)</span> to a complete path.</p></li></ul><p class="SHistory">Changed in version 6.0.0.3 of package <span class="stt">base</span>: Added <span class="stt">PLTUSERHOME</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/private/misc..rkt)._path-list-string-~3epath-list))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-list-string-~3epath-list%29%29" class="RktValDef RktValLink" data-pltdoc="x">path-list-string->path-list</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">str</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">default-path-list</span><span class="RktPn">)</span></td><td><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">default-path-list</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Parses a string or byte string containing a list of paths, and returns
a list of path strings. On Unix and Mac OS X, paths in a path list are
separated by a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">:</span><span class="hspace"></span></span>; on Windows, paths are separated by a
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">;</span><span class="hspace"></span></span>, and all <span class="RktInBG"><span class="hspace"></span><span class="RktIn">"</span><span class="hspace"></span></span>s in the string are discarded. Whenever the path
list contains an empty path, the list
<span class="RktVar">default-path-list</span> is spliced into the returned list of
paths. Parts of <span class="RktVar">str</span> that do not form a valid path are not
included in the returned list.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/private/misc..rkt)._find-executable-path))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._find-executable-path%29%29" class="RktValDef RktValLink" data-pltdoc="x">find-executable-path</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">program-sub</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">related-sub</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">deepest?</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">program-sub</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">related-sub</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">deepest?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Finds a path for the executable <span class="RktVar">program-sub</span>, returning
<span class="RktVal">#f</span> if the path cannot be found.</div></p><p>If <span class="RktVar">related-sub</span> is not <span class="RktVal">#f</span>, then it must be a relative
path string, and the path found for <span class="RktVar">program-sub</span> must be such
that the file or directory <span class="RktVar">related-sub</span> exists in the same
directory as the executable. The result is then the full path for the
found <span class="RktVar">related-sub</span>, instead of the path for the executable.</p><p>This procedure is used by the Racket executable to find the
standard library collection directory (see <a href="collects.html" data-pltdoc="x">Libraries and Collections</a>). In
this case, <span class="RktSym">program</span> is the name used to start Racket and
<span class="RktSym">related</span> is <span class="RktVal">"collects"</span>. The <span class="RktVar">related-sub</span>
argument is used because, on Unix and Mac OS X, <span class="RktVar">program-sub</span> may
involve a sequence of soft links; in this case,
<span class="RktVar">related-sub</span> determines which link in the chain is relevant.</p><p>If <span class="RktVar">related-sub</span> is not <span class="RktVal">#f</span>, then when
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._find-executable-path%29%29" class="RktValLink" data-pltdoc="x">find-executable-path</a></span> does not find a <span class="RktVar">program-sub</span>
that is a link to another file path, the search can continue with the
destination of the link. Further links are inspected until
<span class="RktVar">related-sub</span> is found or the end of the chain of links is
reached. If <span class="RktVar">deepest?</span> is <span class="RktVal">#f</span> (the default), then the
result corresponds to the first path in a chain of links for which
<span class="RktVar">related-sub</span> is found (and further links are not actually
explored); otherwise, the result corresponds to the last link in the
chain for which <span class="RktVar">related-sub</span> is found.</p><p>If <span class="RktVar">program-sub</span> is a pathless name,
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._find-executable-path%29%29" class="RktValLink" data-pltdoc="x">find-executable-path</a></span> gets the value of the
<a name="(idx._(gentag._301._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">PATH</span> environment variable; if this environment
variable is defined, <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._find-executable-path%29%29" class="RktValLink" data-pltdoc="x">find-executable-path</a></span> tries each path in
<span class="stt">PATH</span> as a prefix for <span class="RktVar">program-sub</span> using the search
algorithm described above for path-containing
<span class="RktVar">program-sub</span>s. If the <span class="stt">PATH</span> environment variable is
not defined, <span class="RktVar">program-sub</span> is prefixed with the current
directory and used in the search algorithm above. (On Windows, the
current directory is always implicitly the first item in
<span class="stt">PATH</span>, so <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._find-executable-path%29%29" class="RktValLink" data-pltdoc="x">find-executable-path</a></span> checks the current
directory first on Windows.)</p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""fileutils"">15.2.2<tt> </tt><a name="(part._fileutils)"></a>Files</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._file-exists~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-exists~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">file-exists?</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if a file (not a directory) <span class="RktVar">path</span> exists,
<span class="RktVal">#f</span> otherwise.</div></p><p>On Windows, <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-exists~3f%29%29" class="RktValLink" data-pltdoc="x">file-exists?</a></span> reports <span class="RktVal">#t</span> for all
variations of the special filenames (e.g., <span class="RktVal">"LPT1"</span>,
<span class="RktVal">"x:/baddir/LPT1"</span>).</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._link-exists~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._link-exists~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">link-exists?</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if a link <span class="RktVar">path</span> exists,
<span class="RktVal">#f</span> otherwise.</div></p><p>The predicates <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-exists~3f%29%29" class="RktValLink" data-pltdoc="x">file-exists?</a></span> or <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._directory-exists~3f%29%29" class="RktValLink" data-pltdoc="x">directory-exists?</a></span>
work on the final destination of a link or series of links, while
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._link-exists~3f%29%29" class="RktValLink" data-pltdoc="x">link-exists?</a></span> only follows links to resolve the base part of
<span class="RktVar">path</span> (i.e., everything except the last name in the
path).</p><p>This procedure never raises the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span>
exception.</p><p class="SHistory">Changed in version 6.0.1.12 of package <span class="stt">base</span>: Added support for links on Windows.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._delete-file))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._delete-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">delete-file</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Deletes the file with path <span class="RktVar">path</span> if it exists, otherwise the
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> exception is raised. If <span class="RktVar">path</span> is a link, the link
is deleted rather than the destination of the link.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._rename-file-or-directory))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._rename-file-or-directory%29%29" class="RktValDef RktValLink" data-pltdoc="x">rename-file-or-directory</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">old</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">new</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">exists-ok?</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">old</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">new</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">exists-ok?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Renames the file or directory with path <span class="RktVar">old</span>—<wbr></wbr>if it
exists—<wbr></wbr>to the path <span class="RktVar">new</span>. If the file or directory is not
renamed successfully, the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> exception is raised.</div></p><p>This procedure can be used to move a file/directory to a different
directory (on the same disk) as well as rename a file/directory within
a directory. Unless <span class="RktVar">exists-ok?</span> is provided as a true value,
<span class="RktVar">new</span> cannot refer to an existing file or directory. Even if
<span class="RktVar">exists-ok?</span> is true, <span class="RktVar">new</span> cannot refer to an existing
file when <span class="RktVar">old</span> is a directory, and vice versa.</p><p>If <span class="RktVar">new</span> exists and is replaced, the replacement is atomic
on Unix and Mac OS X, but it is not guaranteed to be atomic on
Windows. Furthermore, if <span class="RktVar">new</span> exists and is opened by any
process for reading or writing, then attempting to replace it will
typically fail on Windows. See also <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-atomic-output-file%29%29" class="RktValLink" data-pltdoc="x">call-with-atomic-output-file</a></span>.</p><p>If <span class="RktVar">old</span> is a link, the link is renamed rather than the
destination of the link, and it counts as a file for replacing any
existing <span class="RktVar">new</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._file-or-directory-modify-seconds))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-modify-seconds%29%29" class="RktValDef RktValLink" data-pltdoc="x">file-or-directory-modify-seconds</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">path</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">secs-n</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">fail-thunk</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">secs-n</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace"> </span></td><td><span class="RktVar">fail-thunk</span></td><td><span class="hspace"> </span></td><td>:</td><td><span class="hspace"> </span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td>=</td><td><span class="hspace"> </span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="exns.html#%28def._%28%28quote._~23~25kernel%29._raise%29%29" class="RktValLink" data-pltdoc="x">raise</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._make-exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">make-exn:fail:filesystem</a></span><span class="hspace"> </span><span class="RktSym">....</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara"><a name="(idx._(gentag._302._(lib._scribblings/reference/reference..scrbl)))"></a>Returns
the file or directory’s last modification date in seconds
since midnight UTC, January 1, 1970 (see also <a href="time.html" data-pltdoc="x">Time</a>) when
<span class="RktVar">secs-n</span> is not provided or is <span class="RktVal">#f</span>.</div></p><p>For FAT filesystems on Windows, directories do not have modification
dates. Therefore, the creation date is returned for a directory, but
the modification date is returned for a file.</p><p>If <span class="RktVar">secs-n</span> is provided and not <span class="RktVal">#f</span>, the access and
modification times of <span class="RktVar">path</span> are set to the given time.</p><p>On error (e.g., if no such file exists), <span class="RktVar">fail-thunk</span> is
called, and the default <span class="RktVar">fail-thunk</span> raises
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._file-or-directory-permissions))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-permissions%29%29" class="RktValDef RktValLink" data-pltdoc="x">file-or-directory-permissions</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>[<span class="RktVar">mode</span>]<span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">read</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">write</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">execute</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-permissions%29%29" class="RktValDef RktValLink" data-pltdoc="x">file-or-directory-permissions</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span><span class="RktVar">mode</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._integer-in%29%29" class="RktValLink" data-pltdoc="x">integer-in</a></span><span class="hspace"> </span><span class="RktVal">0</span><span class="hspace"> </span><span class="RktVal">65535</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">bits</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-permissions%29%29" class="RktValDef RktValLink" data-pltdoc="x">file-or-directory-permissions</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span><span class="RktVar">mode</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void%29%29" class="RktValLink" data-pltdoc="x">void</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._integer-in%29%29" class="RktValLink" data-pltdoc="x">integer-in</a></span><span class="hspace"> </span><span class="RktVal">0</span><span class="hspace"> </span><span class="RktVal">65535</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">When given one argument or <span class="RktVal">#f</span> as the second argument, returns
a list containing <a name="(idx._(gentag._303._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">read</span>, <a name="(idx._(gentag._304._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">write</span>,
and/or <a name="(idx._(gentag._305._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">execute</span> to indicate permission the given file
or directory path by the current user and group. On Unix and Mac OS X,
permissions are checked for the current effective user instead of the
real user.</div></p><p>If <span class="RktVal">'</span><span class="RktVal">bits</span> is supplied as the second argument, the result is a
platform-specific integer encoding of the file or directory properties
(mostly permissions), and the result is independent of the current
user and group. The lowest nine bits of the encoding are somewhat
portable, reflecting permissions for the file or directory’s owner,
members of the file or directory’s group, or other users:</p><ul><li><p><span class="RktVal">#o100</span> : owner has read permission</p></li><li><p><span class="RktVal">#o200</span> : owner has write permission</p></li><li><p><span class="RktVal">#o400</span> : owner has execute permission</p></li><li><p><span class="RktVal">#o010</span> : group has read permission</p></li><li><p><span class="RktVal">#o020</span> : group has write permission</p></li><li><p><span class="RktVal">#o040</span> : group has execute permission</p></li><li><p><span class="RktVal">#o001</span> : others have read permission</p></li><li><p><span class="RktVal">#o002</span> : others have write permission</p></li><li><p><span class="RktVal">#o004</span> : others have execute permission</p></li></ul><p>See also <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._user-read-bit%29%29" class="RktValLink" data-pltdoc="x">user-read-bit</a></span>, etc. On Windows, permissions from
all three (owner, group, and others) are always the same, and read and
execute permission are always available. On Unix and Mac OS X,
higher bits have a platform-specific meaning.</p><p>If an integer is supplied as the second argument, its is used as an
encoding of properties (mostly permissions) to install for the file.</p><p>In all modes, the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> exception is raised on error (e.g., if no
such file exists).</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._file-or-directory-identity))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-identity%29%29" class="RktValDef RktValLink" data-pltdoc="x">file-or-directory-identity</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>[<span class="RktVar">as-link?</span>]<span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-positive-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-positive-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">as-link?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara"><a name="(idx._(gentag._306._(lib._scribblings/reference/reference..scrbl)))"></a>Returns a number that represents the identity of
<span class="RktVar">path</span> in terms of the device and file or directory that it
accesses. This function can be used to check whether two paths
correspond to the same filesystem entity under the assumption that the
path’s entity selection does not change.</div></p><p>If <span class="RktVar">as-link?</span> is a true value, then if <span class="RktVar">path</span> refers to
a filesystem link, the identity of the link is returned instead of the
identity of the referenced file or directory (if any).</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._file-size))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-size%29%29" class="RktValDef RktValLink" data-pltdoc="x">file-size</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns the (logical) size of the specified file in bytes. On Mac
OS X, this size excludes the resource-fork size. On error (e.g., if no
such file exists), the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> exception is raised.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._copy-file))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._copy-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">copy-file</a></span></span><span class="hspace"> </span><span class="RktVar">src</span><span class="hspace"> </span><span class="RktVar">dest</span><span class="hspace"> </span>[<span class="RktVar">exists-ok?</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">src</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">dest</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">exists-ok?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates the file <span class="RktVar">dest</span> as a copy of <span class="RktVar">src</span>, if
<span class="RktVar">dest</span> does not already exist. If <span class="RktVar">dest</span> already exists
and <span class="RktVar">exists-ok?</span> is <span class="RktVal">#f</span>, the copy fails with
<span class="RktSym"><a href="exns.html#%28def._%28%28quote._~23~25kernel%29._exn~3afail~3afilesystem~3aexists~3f%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem:exists?</a></span> exception is raised; otherwise, if <span class="RktVar">dest</span>
exists, its content is replaced with the content of <span class="RktVar">src</span>. File
permissions are transferred from <span class="RktVar">src</span> to <span class="RktVar">dest</span>; on Windows,
the modification time of <span class="RktVar">src</span> is also transferred to <span class="RktVar">dest</span>. If
<span class="RktVar">src</span> refers to a link, the target of the link is copied,
rather than the link itself; if <span class="RktVar">dest</span> refers to a link and
<span class="RktVar">exists-ok?</span> is true, the target of the link is updated.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._make-file-or-directory-link))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._make-file-or-directory-link%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-file-or-directory-link</a></span></span><span class="hspace"> </span><span class="RktVar">to</span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">to</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a link <span class="RktVar">path</span> to <span class="RktVar">to</span>. The
creation will fail if <span class="RktVar">path</span> already exists. The <span class="RktVar">to</span>
need not refer to an existing file or directory, and <span class="RktVar">to</span> is
not expanded before writing the link. If the link is not created
successfully,the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> exception is raised.</div></p><p>On Windows XP and earlier, the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3aunsupported%29%29" class="RktValLink" data-pltdoc="x">exn:fail:unsupported</a></span> exception is raised. On
later versions of Windows, the creation of links tends to be
disallowed by security policies. Furthermore, a relative-path link is
parsed specially; see <a href="windowspaths.html" data-pltdoc="x">Windows Path Conventions</a> for more information.</p><p class="SHistory">Changed in version 6.0.1.12 of package <span class="stt">base</span>: Added support for links on Windows.</p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""directories"">15.2.3<tt> </tt><a name="(part._directories)"></a>Directories</h5><p>See also: <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._rename-file-or-directory%29%29" class="RktValLink" data-pltdoc="x">rename-file-or-directory</a></span>,
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-modify-seconds%29%29" class="RktValLink" data-pltdoc="x">file-or-directory-modify-seconds</a></span>,
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-permissions%29%29" class="RktValLink" data-pltdoc="x">file-or-directory-permissions</a></span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-directory))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-directory</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._complete-path~3f%29%29" class="RktValLink" data-pltdoc="x">complete-path?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-directory</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines the current directory for resolving
relative paths.</div></p><p>When the parameter procedure is called to set the current directory,
the path argument is <a href="pathutils.html#%28tech._cleanse%29" class="techoutside" data-pltdoc="x"><span class="techinside">cleanse</span></a>d using <span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._cleanse-path%29%29" class="RktValLink" data-pltdoc="x">cleanse-path</a></span>,
simplified using <span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._simplify-path%29%29" class="RktValLink" data-pltdoc="x">simplify-path</a></span>, and then converted to a
directory path with <span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path-~3edirectory-path%29%29" class="RktValLink" data-pltdoc="x">path->directory-path</a></span>; cleansing and
simplification raise an exception if the path is ill-formed. Thus, the
current value of <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span> is always a cleansed,
simplified, complete, directory path.</p><p>The path is not checked for existence when the parameter is set.</p><p>On Unix and Mac OS X, the initial value of the parameter for a Racket
process is taken from the <a name="(idx._(gentag._307._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">PWD</span> environment
variable—<wbr></wbr>if the value of the environment variable identifies the
same directory as the operating system’s report of the current
directory.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-directory-for-user))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory-for-user%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-directory-for-user</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._complete-path~3f%29%29" class="RktValLink" data-pltdoc="x">complete-path?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory-for-user%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-directory-for-user</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span>, but use only by
<span class="RktSym"><a href="exns.html#%28def._%28%28quote._~23~25kernel%29._srcloc-~3estring%29%29" class="RktValLink" data-pltdoc="x">srcloc->string</a></span> for reporting paths relative to a
directory.</div></p><p>Normally, <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory-for-user%29%29" class="RktValLink" data-pltdoc="x">current-directory-for-user</a></span> should stay at its
initial value, reflecting the directory where a user started a
process. A tool such as DrRacket, however, implicitly lets a user
select a directory (for the file being edited), in which case updating
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory-for-user%29%29" class="RktValLink" data-pltdoc="x">current-directory-for-user</a></span> makes sense.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-drive))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-drive%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-drive</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Returns the current drive name Windows. For other platforms, the
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3aunsupported%29%29" class="RktValLink" data-pltdoc="x">exn:fail:unsupported</a></span> exception is raised. The current drive is always the drive
of the current directory.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._directory-exists~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._directory-exists~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">directory-exists?</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">path</span> refers to a directory,
<span class="RktVal">#f</span> otherwise.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._make-directory))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._make-directory%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-directory</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a new directory with the path <span class="RktVar">path</span>. If the directory
is not created successfully, the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> exception is raised.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._delete-directory))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._delete-directory%29%29" class="RktValDef RktValLink" data-pltdoc="x">delete-directory</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Deletes an existing directory with the path <span class="RktVar">path</span>. If the
directory is not deleted successfully, the
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> exception is raised.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._directory-list))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._directory-list%29%29" class="RktValDef RktValLink" data-pltdoc="x">directory-list</a></span></span><span class="hspace"> </span>[<span class="RktVar">path</span><span class="hspace"> </span><span class="RktPn">#:build?</span><span class="hspace"> </span><span class="RktVar">build?</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">build?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>See also the <span class="RktSym"><a href="sequences.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._in-directory%29%29" class="RktValLink" data-pltdoc="x">in-directory</a></span> sequence constructor.</p></blockquote></blockquote></blockquote></div></p><p>Returns a list of all files and directories in the directory specified
by <span class="RktVar">path</span>. If <span class="RktVar">build?</span> is <span class="RktVal">#f</span>, the resulting
paths are all <a href="More_Path_Utilities.html#%28tech._path._element%29" class="techoutside" data-pltdoc="x"><span class="techinside">path elements</span></a>; otherwise, the individual results
are combined with <span class="RktVar">path</span> using <span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._build-path%29%29" class="RktValLink" data-pltdoc="x">build-path</a></span>.
On Windows, an element of the result list may start with
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">\\?\REL\\</span><span class="hspace"></span></span>.</p><p>The resulting paths are always sorted using <span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3c~3f%29%29" class="RktValLink" data-pltdoc="x">path<?</a></span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._filesystem-root-list))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-root-list%29%29" class="RktValDef RktValLink" data-pltdoc="x">filesystem-root-list</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Returns a list of all current root directories. Obtaining this list
can be particularly slow on Windows.</div></p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""filesystem-change"">15.2.4<tt> </tt><a name="(part._filesystem-change)"></a>Detecting Filesystem Changes</h5><p>Many operating systems provide notifications for filesystem changes,
and those notifications are reflected in Racket by <a href="#%28tech._filesystem._change._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">filesystem
change events</span></a>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._filesystem-change-evt~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">filesystem-change-evt?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#f</span> if <span class="RktVar">v</span> is a <a href="#%28tech._filesystem._change._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">filesystem change
event</span></a>, <span class="RktVal">#f</span> otherwise.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._filesystem-change-evt))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt%29%29" class="RktValDef RktValLink" data-pltdoc="x">filesystem-change-evt</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt~3f%29%29" class="RktValLink" data-pltdoc="x">filesystem-change-evt?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt%29%29" class="RktValDef RktValLink" data-pltdoc="x">filesystem-change-evt</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span><span class="RktVar">failure-thunk</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">failure-thunk</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a <a name="(tech._filesystem._change._event)"></a><span style="font-style: italic">filesystem change event</span>, which is a
<a href="sync.html#%28tech._synchronizable._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">synchronizable event</span></a> that becomes <a href="sync.html#%28tech._ready._for._synchronization%29" class="techoutside" data-pltdoc="x"><span class="techinside">ready for
synchronization</span></a> after a change to <span class="RktVar">path</span>:</div></p><ul><li><p>If <span class="RktVar">path</span> refers to a file, the event becomes
<a href="sync.html#%28tech._ready._for._synchronization%29" class="techoutside" data-pltdoc="x"><span class="techinside">ready for synchronization</span></a> when the file’s content or
attributes change, or when the file is deleted.</p></li><li><p>If <span class="RktVar">path</span> refers to a directory, the event becomes
<a href="sync.html#%28tech._ready._for._synchronization%29" class="techoutside" data-pltdoc="x"><span class="techinside">ready for synchronization</span></a> if a file or subdirectory is
added, renamed, or removed within the directory.</p></li></ul><p>The event also becomes <a href="sync.html#%28tech._ready._for._synchronization%29" class="techoutside" data-pltdoc="x"><span class="techinside">ready for synchronization</span></a> if
it is passed to <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt-cancel%29%29" class="RktValLink" data-pltdoc="x">filesystem-change-evt-cancel</a></span>.</p><p>Finally, depending on the precision of information available from the
operating system, the event may become <a href="sync.html#%28tech._ready._for._synchronization%29" class="techoutside" data-pltdoc="x"><span class="techinside">ready for
synchronization</span></a> under other circumstances. For example, on
Windows, an event for a file becomes ready when any file changes
within in the same directory as the file.</p><p>After a <a href="#%28tech._filesystem._change._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">filesystem change event</span></a> becomes <a href="sync.html#%28tech._ready._for._synchronization%29" class="techoutside" data-pltdoc="x"><span class="techinside">ready for
synchronization</span></a>, it stays <a href="sync.html#%28tech._ready._for._synchronization%29" class="techoutside" data-pltdoc="x"><span class="techinside">ready for synchronization</span></a>. The
event’s <a href="sync.html#%28tech._synchronization._result%29" class="techoutside" data-pltdoc="x"><span class="techinside">synchronization result</span></a> is the event itself.</p><p>If the current platform does not support filesystem-change
notifications, then the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3aunsupported%29%29" class="RktValLink" data-pltdoc="x">exn:fail:unsupported</a></span> exception is raised if
<span class="RktVar">failure-thunk</span> is not provided, or <span class="RktVar">failure-thunk</span> is
called in tail position if provided. Similarly, if there is any
operating-system error when creating the event (such as a non-existent
file), then the <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> exception is raised or <span class="RktVar">failure-thunk</span>
is called.</p><p>Creation of a <a href="#%28tech._filesystem._change._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">filesystem change event</span></a> alloates resources at the
operating-system level. The resources are released at latest when the
event is sychronized and <a href="sync.html#%28tech._ready._for._synchronization%29" class="techoutside" data-pltdoc="x"><span class="techinside">ready for synchronization</span></a> or when the
event is canceled with <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt-cancel%29%29" class="RktValLink" data-pltdoc="x">filesystem-change-evt-cancel</a></span>.
See also <span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-type%29%29" class="RktValLink" data-pltdoc="x">system-type</a></span> in <span class="RktVal">'</span><span class="RktVal">fs-change</span> mode.</p><p>A <a href="#%28tech._filesystem._change._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">filesystem change event</span></a> is placed under the management of the
<a href="eval-model.html#%28tech._current._custodian%29" class="techoutside" data-pltdoc="x"><span class="techinside">current custodian</span></a> when it is created. If the <a href="eval-model.html#%28tech._custodian%29" class="techoutside" data-pltdoc="x"><span class="techinside">custodian</span></a>
is shut down, <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt-cancel%29%29" class="RktValLink" data-pltdoc="x">filesystem-change-evt-cancel</a></span> is applied to the
event.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._filesystem-change-evt-cancel))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt-cancel%29%29" class="RktValDef RktValLink" data-pltdoc="x">filesystem-change-evt-cancel</a></span></span><span class="hspace"> </span><span class="RktVar">evt</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">evt</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt~3f%29%29" class="RktValLink" data-pltdoc="x">filesystem-change-evt?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Causes <span class="RktVar">evt</span> to become immediately <a href="sync.html#%28tech._ready._for._synchronization%29" class="techoutside" data-pltdoc="x"><span class="techinside">ready for
synchronization</span></a>, whether it was ready or before not, and releases and
resources (at the operating-system level) for tracking filesystem
changes.</div></p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""runtime-path"">15.2.5<tt> </tt><a name="(part._runtime-path)"></a><a name="(mod-path._racket/runtime-path)"></a>Declaring Paths Needed at Run Time</h5><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._racket%2Fruntime-path%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/runtime-path</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">base</span></span></td></tr></table></div><div class="SIntrapara">The bindings documented in this section are provided by the <a href="#%28mod-path._racket%2Fruntime-path%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/runtime-path</span></a> library, not <a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/base</span></a> or <a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket</span></a>.</div></p><p>The <a href="#%28mod-path._racket%2Fruntime-path%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/runtime-path</span></a> library provides forms for
accessing files and directories at run time using a path that are
usually relative to an enclosing source file. Unlike using
<span class="RktSym"><a href="collects.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._collection-path%29%29" class="RktValLink" data-pltdoc="x">collection-path</a></span>, <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span> exposes each
run-time path to tools like the executable and distribution creators,
so that files and directories needed at run time are carried along in
a distribution.</p><p>In addition to the bindings described below,
<a href="#%28mod-path._racket%2Fruntime-path%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/runtime-path</span></a> provides <span class="RktSym"><a href="quote.html#%28form._%28%28quote._~23~25kernel%29._~23~25datum%29%29" class="RktStxLink" data-pltdoc="x">#%datum</a></span> in
<a href="syntax-model.html#%28tech._phase._level%29" class="techoutside" data-pltdoc="x"><span class="techinside">phase level</span></a> 1, since string constants are often used as
compile-time expressions with <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/runtime-path..rkt)._define-runtime-path))"></a><span title="Provided from: racket/runtime-path | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">define-runtime-path</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">expr</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Uses <span class="RktVar">expr</span> as both a compile-time (i.e., <a href="eval-model.html#%28tech._phase%29" class="techoutside" data-pltdoc="x"><span class="techinside">phase</span></a> 1)
expression and a run-time (i.e., <a href="eval-model.html#%28tech._phase%29" class="techoutside" data-pltdoc="x"><span class="techinside">phase</span></a> 0) expression. In either
context, <span class="RktVar">expr</span> should produce a path, a string that represents
a path, a list of the form <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">lib</span><span class="stt"> </span><span class="RktVar">str</span><span class="stt"> </span><span class="RktMeta">...+</span><span class="RktPn">)</span>, or a list
of the form <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">so</span><span class="stt"> </span><span class="RktVar">str</span><span class="RktPn">)</span> or <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">so</span><span class="stt"> </span><span class="RktVar">str</span><span class="stt"> </span><span class="RktVar">vers</span><span class="RktPn">)</span>.</div></p><p>For run time, <span class="RktVar">id</span> is bound to a path that is based on the
result of <span class="RktVar">expr</span>. The path is normally computed by taking a
relative path result from <span class="RktVar">expr</span> and adding it to a path for
the enclosing file (which is computed as described below). However,
tools like the executable creator can also arrange (by colluding with
<a href="#%28mod-path._racket%2Fruntime-path%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/runtime-path</span></a>) to have a different base path
substituted in a generated executable. If <span class="RktVar">expr</span> produces an
absolute path, it is normally returned directly, but again may be
replaced by an executable creator. In all cases, the executable
creator preserves the relative locations of all paths within a given
<a href="collects.html#%28tech._package%29" class="techoutside" data-pltdoc="x"><span class="techinside">package</span></a> (treating paths outside of any package as being together).
When <span class="RktVar">expr</span> produces a relative or absolute path, then the path
bound to <span class="RktVar">id</span> is always an absolute path.</p><p>If <span class="RktVar">expr</span> produces a list of the form <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">lib</span><span class="stt"> </span><span class="RktVar">str</span><span class="stt"> </span><span class="RktMeta">...+</span><span class="RktPn">)</span>, the value bound to <span class="RktVar">id</span> is an absolute path. The path
refers to a collection-based file similar to using the value as a
<a href="Module_Names_and_Loading.html#%28tech._module._path%29" class="techoutside" data-pltdoc="x"><span class="techinside">module path</span></a>.</p><p>If <span class="RktVar">expr</span> produces a list of the form <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">so</span><span class="stt"> </span><span class="RktVar">str</span><span class="RktPn">)</span>
or <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">so</span><span class="stt"> </span><span class="RktVar">str</span><span class="stt"> </span><span class="RktVar">vers</span><span class="RktPn">)</span>,
the value bound to <span class="RktVar">id</span> can be either <span class="RktVar">str</span> or an
absolute path; it is an absolute path when searching in the
Racket-specific shared-object library directories (as determined by
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=raco&rel=dirs.html%23%2528def._%2528%2528lib._setup%252Fdirs..rkt%2529._get-lib-search-dirs%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">get-lib-search-dirs</a></span>) locates the path. In this way, shared-object
libraries that are installed specifically for Racket get carried
along in distributions. The search tries each directory in order;
within a directory, the search tries using <span class="RktVar">str</span> directly,
then it tries adding each version specified by <span class="RktVar">vers</span>—<wbr></wbr>which defaults
to <span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">#f</span><span class="RktVal">)</span>—<wbr></wbr>along with
a platform-specific shared-library extension—<wbr></wbr>as produced by
<span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-type%29%29" class="RktValLink" data-pltdoc="x">system-type</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">so-suffix</span><span class="RktPn">)</span>. A <span class="RktVar">vers</span>
can be a string, or it can be a list of strings and <span class="RktVal">#f</span>.</p><p>If <span class="RktVar">expr</span> produces a list of the form <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">module</span><span class="stt"> </span><span class="RktVar">module-path</span><span class="stt"> </span><span class="RktVar">var-ref</span><span class="RktPn">)</span> or <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">so</span><span class="stt"> </span><span class="RktVar">str</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVar">str-or-false</span><span class="stt"> </span><span class="RktMeta"><a href="stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="RktPn">)</span>, the value bound to <span class="RktVar">id</span> is a
<a href="Module_Names_and_Loading.html#%28tech._module._path._index%29" class="techoutside" data-pltdoc="x"><span class="techinside">module path index</span></a>, where <span class="RktVar">module-path</span> is treated as
relative (if it is relative) to the module that is the home of the
<a href="Locations____variable-reference.html#%28tech._variable._reference%29" class="techoutside" data-pltdoc="x"><span class="techinside">variable reference</span></a> <span class="RktVar">var-ref</span>, where <span class="RktVar">var-ref</span>
can be <span class="RktVal">#f</span> if <span class="RktVar">module-path</span> is absolute. In an
executable, the corresponding module is carried along, including all
of its dependencies.</p><p>For compile-time, the <span class="RktVar">expr</span> result is used by an executable
creator—<wbr></wbr>but not the result when the containing module is
compiled. Instead, <span class="RktVar">expr</span> is preserved in the module as a
compile-time expression (in the sense of
<span class="RktSym"><a href="begin.html#%28form._%28%28quote._~23~25kernel%29._begin-for-syntax%29%29" class="RktStxLink" data-pltdoc="x">begin-for-syntax</a></span>). Later, at the time that an executable is
created, the compile-time portion of the module is executed (again),
and the result of <span class="RktVar">expr</span> is the file to be included with the
executable. The reason for the extra compile-time execution is that
the result of <span class="RktVar">expr</span> might be platform-dependent, so the result
should not be stored in the (platform-independent) bytecode form of
the module; the platform at executable-creation time, however, is the
same as at run time for the executable. Note that <span class="RktVar">expr</span> is
still evaluated at run-time; consequently, avoid procedures like
<span class="RktSym"><a href="collects.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._collection-path%29%29" class="RktValLink" data-pltdoc="x">collection-path</a></span>, which depends on the source installation,
and instead use relative paths and forms like <span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">lib</span><span class="stt"> </span><span class="RktVar">str</span><span class="stt"> </span><span class="RktMeta">...+</span><span class="RktPn">)</span>.</p><p>If a path is needed only on some platforms and not on others, use
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path-list%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path-list</a></span> with an <span class="RktVar">expr</span> that produces an
empty list on platforms where the path is not needed.</p><p>Beware that <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span> in a <a href="syntax-model.html#%28tech._phase._level%29" class="techoutside" data-pltdoc="x"><span class="techinside">phase level</span></a> other
than 0 does not cooperate properly with an executable creator. To work
around that limitation, put <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span> in a separate
module—<wbr></wbr>perhaps a <a href="eval-model.html#%28tech._submodule%29" class="techoutside" data-pltdoc="x"><span class="techinside">submodule</span></a> created by <span class="RktSym"><a href="module.html#%28form._%28%28quote._~23~25kernel%29._module%29%29" class="RktStxLink" data-pltdoc="x">module</a></span>—<wbr></wbr>then
export the definition, and then the module containing the definition
can be <span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span>d into any phase level. Using
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span> in a <a href="syntax-model.html#%28tech._phase._level%29" class="techoutside" data-pltdoc="x"><span class="techinside">phase level</span></a> other than 0
logs a warning at expansion time.</p><p>The enclosing path for a <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span> is determined as
follows from the <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span> syntactic form:</p><ul><li><p>If the form has a source module according to
<span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax-source-module%29%29" class="RktValLink" data-pltdoc="x">syntax-source-module</a></span>, then the source location is
determined by preserving the original expression as a syntax
object, extracting its source module path at run time (again
using <span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax-source-module%29%29" class="RktValLink" data-pltdoc="x">syntax-source-module</a></span>), and then resolving the
resulting module path index.</p></li><li><p>If the expression has no source module, the
<span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax-source%29%29" class="RktValLink" data-pltdoc="x">syntax-source</a></span> location associated with the form is
used, if is a string or path.</p></li><li><p>If no source module is available, and <span class="RktSym"><a href="stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax-source%29%29" class="RktValLink" data-pltdoc="x">syntax-source</a></span>
produces no path, then <span class="RktSym"><a href="eval.html#%28def._%28%28quote._~23~25kernel%29._current-load-relative-directory%29%29" class="RktValLink" data-pltdoc="x">current-load-relative-directory</a></span>
is used if it is not <span class="RktVal">#f</span>. Finally,
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span> is used if all else fails.</p></li></ul><p>In the latter two cases, the path is normally preserved in
(platform-specific) byte form, but if the enclosing path corresponds to a
result of <span class="RktSym"><a href="collects.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._collection-file-path%29%29" class="RktValLink" data-pltdoc="x">collection-file-path</a></span>, then the path is record as
relative to the corresponding module path.</p><p class="SHistory">Changed in version 6.0.1.6 of package <span class="stt">base</span>: Preserve relative paths only within a package.</p><p>Examples:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">Access a file </span><span class="stt">"data.txt"</span><span class="RktCmt"> at run-time that is originally</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">located in the same directory as the module source file:</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span><span class="hspace"> </span><span class="RktSym">data-file</span><span class="hspace"> </span><span class="RktVal">"data.txt"</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">read-data</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._with-input-from-file%29%29" class="RktValLink" data-pltdoc="x">with-input-from-file</a></span><span class="hspace"> </span><span class="RktSym">data-file</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Byte_and_String_Input.html#%28def._%28%28quote._~23~25kernel%29._read-bytes%29%29" class="RktValLink" data-pltdoc="x">read-bytes</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-size%29%29" class="RktValLink" data-pltdoc="x">file-size</a></span><span class="hspace"> </span><span class="RktSym">data-file</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">Load a platform-specific shared object (using </span><span class="RktSym">ffi-lib</span><span class="RktCmt">)</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">that is located in a platform-specific sub-directory of the</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">module</span><span class="RktCmt">'</span><span class="RktCmt">s source directory:</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span><span class="hspace"> </span><span class="RktSym">libfit-path</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._build-path%29%29" class="RktValLink" data-pltdoc="x">build-path</a></span><span class="hspace"> </span><span class="RktVal">"compiled"</span><span class="hspace"> </span><span class="RktVal">"native"</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-library-subpath%29%29" class="RktValLink" data-pltdoc="x">system-library-subpath</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-replace-suffix%29%29" class="RktValLink" data-pltdoc="x">path-replace-suffix</a></span><span class="hspace"> </span><span class="RktVal">"libfit"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-type%29%29" class="RktValLink" data-pltdoc="x">system-type</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">so-suffix</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">libfit</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">ffi-lib</span><span class="hspace"> </span><span class="RktSym">libfit-path</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">Load a platform-specific shared object that might be installed</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">as part of the operating system, or might be installed</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">specifically for Racket:</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span><span class="hspace"> </span><span class="RktSym">libssl-so</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="case.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._case%29%29" class="RktStxLink" data-pltdoc="x">case</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-type%29%29" class="RktValLink" data-pltdoc="x">system-type</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">windows</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">so</span><span class="hspace"> </span><span class="RktVal">"ssleay32"</span><span class="RktVal">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">so</span><span class="hspace"> </span><span class="RktVal">"libssl"</span><span class="RktVal">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">libssl</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">ffi-lib</span><span class="hspace"> </span><span class="RktSym">libssl-so</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/runtime-path..rkt)._define-runtime-paths))"></a><span title="Provided from: racket/runtime-path | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-paths%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">define-runtime-paths</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">expr</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span>, but declares and binds multiple
paths at once. The <span class="RktVar">expr</span> should produce as many values as
<span class="RktVar">id</span>s.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/runtime-path..rkt)._define-runtime-path-list))"></a><span title="Provided from: racket/runtime-path | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path-list%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">define-runtime-path-list</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">expr</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span>, but <span class="RktVar">expr</span> should produce a
list of paths.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/runtime-path..rkt)._define-runtime-module-path-index))"></a><span title="Provided from: racket/runtime-path | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-module-path-index%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">define-runtime-module-path-index</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">module-path-expr</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Similar to <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span>, but <span class="RktVar">id</span> is bound to a
<a href="Module_Names_and_Loading.html#%28tech._module._path._index%29" class="techoutside" data-pltdoc="x"><span class="techinside">module path index</span></a> that encapsulates the result of
<span class="RktVar">module-path-expr</span> relative to the enclosing module.</div></p><p>Use <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-module-path-index%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-module-path-index</a></span> to bind a module path that is
passed to a reflective function like <span class="RktSym"><a href="Module_Names_and_Loading.html#%28def._%28%28quote._~23~25kernel%29._dynamic-require%29%29" class="RktValLink" data-pltdoc="x">dynamic-require</a></span> while
also creating a module dependency for building and distributing
executables.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/runtime-path..rkt)._runtime-require))"></a><span title="Provided from: racket/runtime-path | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._runtime-require%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">runtime-require</a></span></span><span class="hspace"> </span><span class="RktVar">module-path</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Similar to <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-module-path-index%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-module-path-index</a></span>, but creates the
distribution dependency without binding a module path index. When
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._runtime-require%29%29" class="RktStxLink" data-pltdoc="x">runtime-require</a></span> is used multiple times within a module with
the same <span class="RktVar">module-path</span>, all but the first use expands to an
empty <span class="RktSym"><a href="begin.html#%28form._%28%28quote._~23~25kernel%29._begin%29%29" class="RktStxLink" data-pltdoc="x">begin</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/runtime-path..rkt)._define-runtime-module-path))"></a><span title="Provided from: racket/runtime-path | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-module-path%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">define-runtime-module-path</a></span></span><span class="hspace"> </span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">module-path</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Similar to <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-path</a></span>, but <span class="RktVar">id</span> is bound to a
<a href="Module_Names_and_Loading.html#%28tech._resolved._module._path%29" class="techoutside" data-pltdoc="x"><span class="techinside">resolved module path</span></a>. The <a href="Module_Names_and_Loading.html#%28tech._resolved._module._path%29" class="techoutside" data-pltdoc="x"><span class="techinside">resolved module path</span></a> for
<span class="RktVar">id</span> corresponds to <span class="RktVar">module-path</span> (with the same syntax
as a module path for <span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span>), which can be relative to the
enclosing module.</div></p><p>The <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-module-path-index%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-module-path-index</a></span> form is usually
preferred, because it creates a weaker link to the referenced module.
Unlike <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-module-path-index%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-module-path-index</a></span>, the
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-module-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-module-path</a></span> form creates a <span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for-label%29%29" class="RktStxLink" data-pltdoc="x">for-label</a></span>
dependency from an enclosing module to <span class="RktVar">module-path</span>. Since the
dependency is merely <span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for-label%29%29" class="RktStxLink" data-pltdoc="x">for-label</a></span>, <span class="RktVar">module-path</span> is not
<a href="eval-model.html#%28tech._instantiate%29" class="techoutside" data-pltdoc="x"><span class="techinside">instantiate</span></a>d or <a href="syntax-model.html#%28tech._visit%29" class="techoutside" data-pltdoc="x"><span class="techinside">visit</span></a>ed when the enclosing module is
<a href="eval-model.html#%28tech._instantiate%29" class="techoutside" data-pltdoc="x"><span class="techinside">instantiate</span></a>d or <a href="syntax-model.html#%28tech._visit%29" class="techoutside" data-pltdoc="x"><span class="techinside">visit</span></a>ed (unless such a dependency is
created by other <span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span>s), but the code for the referenced
module is loaded when the enclosing module is loaded.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/runtime-path..rkt)._runtime-paths))"></a><span title="Provided from: racket/runtime-path | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._runtime-paths%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">runtime-paths</a></span></span><span class="hspace"> </span><span class="RktVar">module-path</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">This form is mainly for use by tools such as executable builders. It
expands to a quoted list containing the run-time paths declared by
<span class="RktVar">module-path</span>, returning the compile-time results of the
declaration <span class="RktSym">expr</span>s, except that paths are converted to byte
strings. The enclosing module must require (directly or indirectly)
the module specified by <span class="RktVar">module-path</span>, which is an unquoted
module path. The resulting list does <span style="font-style: italic">not</span> include module paths
bound through <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-module-path%29%29" class="RktStxLink" data-pltdoc="x">define-runtime-module-path</a></span>.</div></p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""file-lib"">15.2.6<tt> </tt><a name="(part._file-lib)"></a><a name="(mod-path._racket/file)"></a>More File and Directory Utilities</h5><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._racket%2Ffile%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/file</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">base</span></span></td></tr></table></div><div class="SIntrapara">The bindings documented in this section are provided by the <a href="#%28mod-path._racket%2Ffile%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/file</span></a> and <a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket</span></a> libraries, but not <a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket/base</span></a>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._file-~3estring))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3estring%29%29" class="RktValDef RktValLink" data-pltdoc="x">file->string</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>[<span class="RktPn">#:mode</span><span class="hspace"> </span><span class="RktVar">mode-flag</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode-flag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">text</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span></td></tr></table></blockquote></div><div class="SIntrapara">Reads all characters from <span class="RktVar">path</span> and returns them as a string.
The <span class="RktVar">mode-flag</span> argument is the same as for
<span class="RktSym"><a href="file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-input-file%29%29" class="RktValLink" data-pltdoc="x">open-input-file</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._file-~3ebytes))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3ebytes%29%29" class="RktValDef RktValLink" data-pltdoc="x">file->bytes</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>[<span class="RktPn">#:mode</span><span class="hspace"> </span><span class="RktVar">mode-flag</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode-flag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">text</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span></td></tr></table></blockquote></div><div class="SIntrapara">Reads all characters from <span class="RktVar">path</span> and returns them as a
<a href="bytestrings.html#%28tech._byte._string%29" class="techoutside" data-pltdoc="x"><span class="techinside">byte string</span></a>. The <span class="RktVar">mode-flag</span> argument is the same as
for <span class="RktSym"><a href="file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-input-file%29%29" class="RktValLink" data-pltdoc="x">open-input-file</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._file-~3evalue))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3evalue%29%29" class="RktValDef RktValLink" data-pltdoc="x">file->value</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>[<span class="RktPn">#:mode</span><span class="hspace"> </span><span class="RktVar">mode-flag</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode-flag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">text</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span></td></tr></table></blockquote></div><div class="SIntrapara">Reads a single S-expression from <span class="RktVar">path</span> using <span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read%29%29" class="RktValLink" data-pltdoc="x">read</a></span>.
The <span class="RktVar">mode-flag</span> argument is the same as for
<span class="RktSym"><a href="file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-input-file%29%29" class="RktValLink" data-pltdoc="x">open-input-file</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._file-~3elist))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3elist%29%29" class="RktValDef RktValLink" data-pltdoc="x">file->list</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>[<span class="RktVar">proc</span><span class="hspace"> </span><span class="RktPn">#:mode</span><span class="hspace"> </span><span class="RktVar">mode-flag</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read%29%29" class="RktValLink" data-pltdoc="x">read</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode-flag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">text</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span></td></tr></table></blockquote></div><div class="SIntrapara">Repeatedly calls <span class="RktVar">proc</span> to consume the contents of
<span class="RktVar">path</span>, until <span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._eof%29%29" class="RktValLink" data-pltdoc="x">eof</a></span> is produced. The <span class="RktVar">mode-flag</span>
argument is the same as for <span class="RktSym"><a href="file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-input-file%29%29" class="RktValLink" data-pltdoc="x">open-input-file</a></span>. </div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._file-~3elines))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3elines%29%29" class="RktValDef RktValLink" data-pltdoc="x">file->lines</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">path</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:mode</span><span class="hspace"> </span><span class="RktVar">mode-flag</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:line-mode</span><span class="hspace"> </span><span class="RktVar">line-mode</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode-flag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">text</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace"> </span></td><td><span class="RktVar">line-mode</span></td><td><span class="hspace"> </span></td><td>:</td><td><span class="hspace"> </span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">linefeed</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">return</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">return-linefeed</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">any</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">any-one</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td>=</td><td><span class="hspace"> </span></td><td><span class="RktVal">'</span><span class="RktVal">any</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Read all characters from <span class="RktVar">path</span>, breaking them into lines. The
<span class="RktVar">line-mode</span> argument is the same as the second argument to
<span class="RktSym"><a href="Byte_and_String_Input.html#%28def._%28%28quote._~23~25kernel%29._read-line%29%29" class="RktValLink" data-pltdoc="x">read-line</a></span>, but the default is <span class="RktVal">'</span><span class="RktVal">any</span> instead of
<span class="RktVal">'</span><span class="RktVal">linefeed</span>. The <span class="RktVar">mode-flag</span> argument is the same as for
<span class="RktSym"><a href="file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-input-file%29%29" class="RktValLink" data-pltdoc="x">open-input-file</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._file-~3ebytes-lines))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3ebytes-lines%29%29" class="RktValDef RktValLink" data-pltdoc="x">file->bytes-lines</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">path</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:mode</span><span class="hspace"> </span><span class="RktVar">mode-flag</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:line-mode</span><span class="hspace"> </span><span class="RktVar">line-mode</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode-flag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">text</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace"> </span></td><td><span class="RktVar">line-mode</span></td><td><span class="hspace"> </span></td><td>:</td><td><span class="hspace"> </span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">linefeed</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">return</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">return-linefeed</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">any</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">any-one</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td>=</td><td><span class="hspace"> </span></td><td><span class="RktVal">'</span><span class="RktVal">any</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._file-~3elines%29%29" class="RktValLink" data-pltdoc="x">file->lines</a></span>, but reading bytes and collecting them into
lines like <span class="RktSym"><a href="Byte_and_String_Input.html#%28def._%28%28quote._~23~25kernel%29._read-bytes-line%29%29" class="RktValLink" data-pltdoc="x">read-bytes-line</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._display-to-file))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._display-to-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">display-to-file</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">v</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">path</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:mode</span><span class="hspace"> </span><span class="RktVar">mode-flag</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:exists</span><span class="hspace"> </span><span class="RktVar">exists-flag</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode-flag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">text</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace"> </span></td><td><span class="RktVar">exists-flag</span></td><td><span class="hspace"> </span></td><td>:</td><td><span class="hspace"> </span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">error</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">append</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">update</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">replace</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">truncate</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">truncate/replace</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td>=</td><td><span class="hspace"> </span></td><td><span class="RktVal">'</span><span class="RktVal">error</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Uses <span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._display%29%29" class="RktValLink" data-pltdoc="x">display</a></span> to print <span class="RktVar">v</span> to <span class="RktVar">path</span>. The <span class="RktVar">mode-flag</span> and
<span class="RktVar">exists-flag</span> arguments are the same as for
<span class="RktSym"><a href="file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-output-file%29%29" class="RktValLink" data-pltdoc="x">open-output-file</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._write-to-file))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._write-to-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">write-to-file</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">v</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">path</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:mode</span><span class="hspace"> </span><span class="RktVar">mode-flag</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:exists</span><span class="hspace"> </span><span class="RktVar">exists-flag</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode-flag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">text</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace"> </span></td><td><span class="RktVar">exists-flag</span></td><td><span class="hspace"> </span></td><td>:</td><td><span class="hspace"> </span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">error</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">append</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">update</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">replace</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">truncate</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">truncate/replace</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td>=</td><td><span class="hspace"> </span></td><td><span class="RktVal">'</span><span class="RktVal">error</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._display-to-file%29%29" class="RktValLink" data-pltdoc="x">display-to-file</a></span>, but using <span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._write%29%29" class="RktValLink" data-pltdoc="x">write</a></span> instead of <span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._display%29%29" class="RktValLink" data-pltdoc="x">display</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._display-lines-to-file))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._display-lines-to-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">display-lines-to-file</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">lst</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">path</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:separator</span><span class="hspace"> </span><span class="RktVar">separator</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:mode</span><span class="hspace"> </span><span class="RktVar">mode-flag</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:exists</span><span class="hspace"> </span><span class="RktVar">exists-flag</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">lst</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" class="RktValLink" data-pltdoc="x">list?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">separator</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#"\n"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">mode-flag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">text</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">binary</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace"> </span></td><td><span class="RktVar">exists-flag</span></td><td><span class="hspace"> </span></td><td>:</td><td><span class="hspace"> </span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">error</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">append</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">update</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">replace</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">truncate</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">truncate/replace</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td>=</td><td><span class="hspace"> </span></td><td><span class="RktVal">'</span><span class="RktVal">error</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Displays each element of <span class="RktVar">lst</span> to <span class="RktVar">path</span>, adding
<span class="RktVar">separator</span> after each element. The <span class="RktVar">mode-flag</span> and
<span class="RktVar">exists-flag</span> arguments are the same as for
<span class="RktSym"><a href="file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-output-file%29%29" class="RktValLink" data-pltdoc="x">open-output-file</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td colspan="3"><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._copy-directory/files))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._copy-directory%2Ffiles%29%29" class="RktValDef RktValLink" data-pltdoc="x">copy-directory/files</a></span></span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">src</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">dest</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:keep-modify-seconds?</span><span class="hspace"> </span><span class="RktVar">keep-modify-seconds?</span><span class="RktPn">)</span></td><td><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">src</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">dest</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">keep-modify-seconds?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Copies the file or directory <span class="RktVar">src</span> to <span class="RktVar">dest</span>, raising
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> if the file or directory cannot be
copied, possibly because <span class="RktVar">dest</span> exists already. If <span class="RktVar">src</span>
is a directory, the copy applies recursively to the directory’s
content. If a source is a link, the target of the link is copied
rather than the link itself.</div></p><p>If <span class="RktVar">keep-modify-seconds?</span> is <span class="RktVal">#f</span>false, then file copies
keep only the properties kept by <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._copy-file%29%29" class="RktValLink" data-pltdoc="x">copy-file</a></span>, If
<span class="RktVar">keep-modify-seconds?</span> is true, then each file copy also keeps
the modification date of the original.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._delete-directory/files))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._delete-directory%2Ffiles%29%29" class="RktValDef RktValLink" data-pltdoc="x">delete-directory/files</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">path</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:must-exist?</span><span class="hspace"> </span><span class="RktVar">must-exist?</span><span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">must-exist?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#t</span></td></tr></table></blockquote></div><div class="SIntrapara">Deletes the file or directory specified by <span class="RktVar">path</span>, raising
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> if the file or directory cannot be
deleted. If <span class="RktVar">path</span> is a directory, then
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._delete-directory%2Ffiles%29%29" class="RktValLink" data-pltdoc="x">delete-directory/files</a></span> is first applied to each file and
directory in <span class="RktVar">path</span> before the directory is deleted.</div></p><p>If <span class="RktVar">must-exist?</span> is true, then <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29" class="RktValLink" data-pltdoc="x">exn:fail:filesystem</a></span> is
raised if <span class="RktVar">path</span> does not exist. If <span class="RktVar">must-exist?</span> is
false, then <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._delete-directory%2Ffiles%29%29" class="RktValLink" data-pltdoc="x">delete-directory/files</a></span> succeeds if <span class="RktVar">path</span>
does not exist (but a failure is possible if <span class="RktVar">path</span> initially
exists and is removed by another thread or process before
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._delete-directory%2Ffiles%29%29" class="RktValLink" data-pltdoc="x">delete-directory/files</a></span> deletes it).</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._find-files))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._find-files%29%29" class="RktValDef RktValLink" data-pltdoc="x">find-files</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">predicate</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">start-path</span>]</td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:follow-links?</span><span class="hspace"> </span><span class="RktVar">follow-links?</span><span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">predicate</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">follow-links?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Traverses the filesystem starting at <span class="RktVar">start-path</span> and creates a
list of all files and directories for which <span class="RktVar">predicate</span> returns
true. If <span class="RktVar">start-path</span> is <span class="RktVal">#f</span>, then the traversal starts
from <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span><span class="RktPn">)</span>. In the resulting list, each
directory precedes its content.</div></p><p>The <span class="RktVar">predicate</span> procedure is called with a single argument for
each file or directory. If <span class="RktVar">start-path</span> is <span class="RktVal">#f</span>, the
argument is a pathname string that is relative to the current
directory. Otherwise, it is a path building on
<span class="RktVar">start-path</span>. Consequently, supplying
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span><span class="RktPn">)</span> for <span class="RktVar">start-path</span> is different from
supplying <span class="RktVal">#f</span>, because <span class="RktVar">predicate</span> receives complete
paths in the former case and relative paths in the latter. Another
difference is that <span class="RktVar">predicate</span> is not called for the current
directory when <span class="RktVar">start-path</span> is <span class="RktVal">#f</span>.</p><p>If <span class="RktVar">follow-links?</span> is true, the <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._find-files%29%29" class="RktValLink" data-pltdoc="x">find-files</a></span> traversal
follows links, and links are not included in the result. If
<span class="RktVar">follow-links?</span> is <span class="RktVal">#f</span>, then links are not followed,
and links are included in the result.</p><p>If <span class="RktVar">start-path</span> does not refer to an existing file or
directory, then <span class="RktVar">predicate</span> will be called exactly once with
<span class="RktVar">start-path</span> as the argument.</p><p>The <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._find-files%29%29" class="RktValLink" data-pltdoc="x">find-files</a></span> procedure raises and exception if it encounters
a directory for which <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._directory-list%29%29" class="RktValLink" data-pltdoc="x">directory-list</a></span> fails.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._pathlist-closure))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._pathlist-closure%29%29" class="RktValDef RktValLink" data-pltdoc="x">pathlist-closure</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">path-list</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:follow-links?</span><span class="hspace"> </span><span class="RktVar">follow-links?</span><span class="RktPn">)</span></td><td><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path-list</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">follow-links?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Given a list of paths, either absolute or relative to the current
directory, returns a list such that</div></p><ul><li><p>if a nested path is given, all of its ancestors are also
included in the result (but the same ancestor is not added
twice);</p></li><li><p>if a path refers to directory, all of its descendants are also
included in the result;</p></li><li><p>ancestor directories appear before their descendants in the
result list.</p></li></ul><p>If <span class="RktVar">follow-links?</span> is true, then the traversal of directories
and files follows links, and the link paths are not included in the
result. If <span class="RktVar">follow-links?</span> is <span class="RktVal">#f</span>, then he result list
includes paths to link and the links are not followed.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._fold-files))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._fold-files%29%29" class="RktValDef RktValLink" data-pltdoc="x">fold-files</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">proc</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">init-val</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">start-path</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">follow-links?</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace"> </span></td><td><span class="RktVar">proc</span></td><td><span class="hspace"> </span></td><td>:</td><td><span class="hspace"> </span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">file</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dir</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">link</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">file</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">dir</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">link</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="values.html#%28def._%28%28quote._~23~25kernel%29._values%29%29" class="RktValLink" data-pltdoc="x">values</a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">init-val</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">follow-links?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#t</span></td></tr></table></blockquote></div><div class="SIntrapara">Traverses the filesystem starting at <span class="RktVar">start-path</span>, calling
<span class="RktVar">proc</span> on each discovered file, directory, and link. If
<span class="RktVar">start-path</span> is <span class="RktVal">#f</span>, then the traversal starts from
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span><span class="RktPn">)</span>.</div></p><p>The <span class="RktVar">proc</span> procedure is called with three arguments for each
file, directory, or link:</p><ul><li><p>If <span class="RktVar">start-path</span> is <span class="RktVal">#f</span>, the first argument is a
pathname string that is relative to the current directory. Otherwise,
the first argument is a pathname that starts with
<span class="RktVar">start-path</span>. Consequently, supplying
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-directory%29%29" class="RktValLink" data-pltdoc="x">current-directory</a></span><span class="RktPn">)</span> for <span class="RktVar">start-path</span> is different
from supplying <span class="RktVal">#f</span>, because <span class="RktVar">proc</span> receives complete
paths in the former case and relative paths in the latter. Another
difference is that <span class="RktVar">proc</span> is not called for the current
directory when <span class="RktVar">start-path</span> is <span class="RktVal">#f</span>.</p></li><li><p>The second argument is a symbol, either <span class="RktVal">'</span><span class="RktVal">file</span>,
<span class="RktVal">'</span><span class="RktVal">dir</span>, or <span class="RktVal">'</span><span class="RktVal">link</span>. The second argument can be
<span class="RktVal">'</span><span class="RktVal">link</span> when <span class="RktVar">follow-links?</span> is <span class="RktVal">#f</span>,
in which case the filesystem traversal does not follow links. If
<span class="RktVar">follow-links?</span> is <span class="RktVal">#t</span>, then <span class="RktVar">proc</span>
will only get a <span class="RktVal">'</span><span class="RktVal">link</span> as a second argument when it
encounters a dangling symbolic link (one that does not resolve to an
existing file or directory).</p></li><li><p>The third argument is the accumulated result. For the first
call to <span class="RktVar">proc</span>, the third argument is <span class="RktVar">init-val</span>. For the
second call to <span class="RktVar">proc</span> (if any), the third argument is the result
from the first call, and so on. The result of the last call to
<span class="RktVar">proc</span> is the result of <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._fold-files%29%29" class="RktValLink" data-pltdoc="x">fold-files</a></span>.</p></li></ul><p>The <span class="RktVar">proc</span> argument is used in an analogous way to the
procedure argument of <span class="RktSym"><a href="pairs.html#%28def._%28%28lib._racket%2Fprivate%2Flist..rkt%29._foldl%29%29" class="RktValLink" data-pltdoc="x">foldl</a></span>, where its result is used as the
new accumulated result. There is an exception for the case of a
directory (when the second argument is <span class="RktVal">'</span><span class="RktVal">dir</span>): in this case
the procedure may return two values, the second indicating whether the
recursive scan should include the given directory or not. If it
returns a single value, the directory is scanned. In the cases of
files or links (when the second argument is <span class="RktVal">'</span><span class="RktVal">file</span> or
<span class="RktVal">'</span><span class="RktVal">link</span>), a second value is permitted but ignored.</p><p>If the <span class="RktVar">start-path</span> is provided but no such path exists, or if
paths disappear during the scan, then an exception is raised.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._make-directory*))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-directory%2A%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-directory*</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Creates directory specified by <span class="RktVar">path</span>, creating intermediate
directories as necessary, and never failing if <span class="RktVar">path</span> exists
already.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._make-temporary-file))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-temporary-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-temporary-file</a></span></span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">template</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">copy-from-filename</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">directory</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">template</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">"rkttmp~a"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">copy-from-filename</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">directory</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">directory</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a new temporary file and returns a pathname string for the
file. Instead of merely generating a fresh file name, the file is
actually created; this prevents other threads or processes from
picking the same temporary name.</div></p><p>The <span class="RktVar">template</span> argument must be a format string suitable
for use with <span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._format%29%29" class="RktValLink" data-pltdoc="x">format</a></span> and one additional string argument (where
the string contains only digits). If the resulting string is a
relative path, it is combined with the result of
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValLink" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">temp-dir</span><span class="RktPn">)</span>, unless <span class="RktVar">directory</span> is
provided and non-<span class="RktVal">#f</span>, in which case the
file name generated from <span class="RktVar">template</span> is combined with
<span class="RktVar">directory</span> to obtain a full path.</p><p>The <span class="RktVar">template</span> argument’s default is only the string <span class="RktVal">"rkttmp~a"</span>
when there is no source location information for the callsite of
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-temporary-file%29%29" class="RktValLink" data-pltdoc="x">make-temporary-file</a></span> (or if <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-temporary-file%29%29" class="RktValLink" data-pltdoc="x">make-temporary-file</a></span> is
used in a higher-order position). If there is such information, then the template
string is based on the source location.</p><p>If <span class="RktVar">copy-from-filename</span> is provided as path, the temporary file
is created as a copy of the named file (using <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._copy-file%29%29" class="RktValLink" data-pltdoc="x">copy-file</a></span>). If
<span class="RktVar">copy-from-filename</span> is <span class="RktVal">#f</span>, the temporary file is
created as empty. If <span class="RktVar">copy-from-filename</span> is
<span class="RktVal">'</span><span class="RktVal">directory</span>, then the temporary “file” is created as a
directory.</p><p>When a temporary file is created, it is not opened for reading or
writing when the pathname is returned. The client program calling
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-temporary-file%29%29" class="RktValLink" data-pltdoc="x">make-temporary-file</a></span> is expected to open the file with the
desired access and flags (probably using the <span class="RktVal">'</span><span class="RktVal">truncate</span> flag;
see <span class="RktSym"><a href="file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-output-file%29%29" class="RktValLink" data-pltdoc="x">open-output-file</a></span>) and to delete it when it is no longer
needed.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._call-with-atomic-output-file))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-atomic-output-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">call-with-atomic-output-file</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">file</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">proc</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:security-guard</span><span class="hspace"> </span><span class="RktVar">security-guard</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">file</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">port</span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">tmp-path</span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">security-guard</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="securityguards.html#%28def._%28%28quote._~23~25kernel%29._security-guard~3f%29%29" class="RktValLink" data-pltdoc="x">security-guard?</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Opens a temporary file for writing in the same directory as
<span class="RktVar">file</span>, calls <span class="RktVar">proc</span> to write to the temporary file, and
then atomically moves the temporary file in place of <span class="RktVar">proc</span>.
The atomic move simply uses <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._rename-file-or-directory%29%29" class="RktValLink" data-pltdoc="x">rename-file-or-directory</a></span> on Unix
and Mac OS X, but it uses an extra rename step (see below) on Windows
to avoid problems due to concurrent readers of <span class="RktVar">file</span>.</div></p><p>The <span class="RktVar">proc</span> function is called with an output port for the
temporary file, plus the path of the temporary file. The result of
<span class="RktVar">proc</span> is the result of <span class="RktSym">call-with-atomic-output</span>.</p><p>The <span class="RktSym">call-with-atomic-output</span> function arranges to delete
temporary files on exceptions.</p><p>Windows prevents programs from deleting or replacing files that are
open, but it allows renaming of open files. Therefore, on Windows,
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-atomic-output-file%29%29" class="RktValLink" data-pltdoc="x">call-with-atomic-output-file</a></span> creates a second temporary file
<span class="RktVar">extra-tmp-file</span>, renames <span class="RktVar">file</span> to
<span class="RktVar">extra-tmp-file</span>, renames the temporary file written by
<span class="RktVar">proc</span> to <span class="RktSym">p</span>, and finally deletes
<span class="RktVar">extra-tmp-file</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._get-preference))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._get-preference%29%29" class="RktValDef RktValLink" data-pltdoc="x">get-preference</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">name</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">failure-thunk</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">flush-mode</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">filename</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:use-lock?</span><span class="hspace"> </span><span class="RktVar">use-lock?</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:timeout-lock-there</span><span class="hspace"> </span><span class="RktVar">timeout-lock-there</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:lock-there</span><span class="hspace"> </span><span class="RktVar">lock-there</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">failure-thunk</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">flush-mode</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">timestamp</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">filename</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym">string-path?</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">use-lock?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#t</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">timeout-lock-there</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace"> </span></td><td><span class="RktVar">lock-there</span></td><td><span class="hspace"> </span></td><td>:</td><td><span class="hspace"> </span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td>=</td><td><span class="hspace"> </span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-handle-get-preference-locked%29%29" class="RktValLink" data-pltdoc="x">make-handle-get-preference-locked</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">0.01</span><span class="hspace"> </span><span class="RktVar">name</span><span class="hspace"> </span><span class="RktVar">failure-thunk</span><span class="hspace"> </span><span class="RktVar">flush-mode</span><span class="hspace"> </span><span class="RktVar">filename</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:lock-there</span><span class="hspace"> </span><span class="RktVar">timeout-lock-there</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Extracts a preference value from the file designated by
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValLink" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">pref-file</span><span class="RktPn">)</span>, or by <span class="RktVar">filename</span> if it
is provided and is not <span class="RktVal">#f</span>. In the former case, if the
preference file doesn’t exist, <span class="RktSym">get-preferences</span> attempts to
read an <a href="#%28elem._old-prefs%29" data-pltdoc="x">old preferences file</a>, and then a
<span class="stt">"racket-prefs.rktd"</span> file in the configuration directory
(as reported by <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=raco&rel=dirs.html%23%2528def._%2528%2528lib._setup%252Fdirs..rkt%2529._find-config-dir%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">find-config-dir</a></span>), instead. If none of those
files exists, the preference set is empty.</div></p><p>The preference file should contain a list of symbol–value lists
written with the default parameter settings. Keys
starting with <span class="RktSym">racket:</span>, <span class="RktSym">mzscheme:</span>, <span class="RktSym">mred:</span>,
and <span class="RktSym">plt:</span> in any letter case are reserved for use by Racket
implementors. If the preference file does not contain a list
of symbol–value lists, an error is logged via <span class="RktSym"><a href="logging.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._log-error%29%29" class="RktStxLink" data-pltdoc="x">log-error</a></span>
and <span class="RktVar">failure-thunk</span> is called.</p><p>The result of <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._get-preference%29%29" class="RktValLink" data-pltdoc="x">get-preference</a></span> is the value associated with
<span class="RktVar">name</span> if it exists in the association list, or the result of
calling <span class="RktVar">failure-thunk</span> otherwise.</p><p>Preference settings are cached (weakly) across calls to
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._get-preference%29%29" class="RktValLink" data-pltdoc="x">get-preference</a></span>, using <span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path-~3ecomplete-path%29%29" class="RktValLink" data-pltdoc="x">path->complete-path</a></span><span class="stt"> </span><span class="RktVar">filename</span><span class="RktPn">)</span>
as a cache key. If <span class="RktVar">flush-mode</span> is provided as <span class="RktVal">#f</span>, the
cache is used instead of re-consulting the preferences file. If
<span class="RktVar">flush-mode</span> is provided as <span class="RktVal">'</span><span class="RktVal">timestamp</span> (the default),
then the cache is used only if the file has a timestamp that is the
same as the last time the file was read. Otherwise, the file is
re-consulted.</p><p>On platforms for which <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._preferences-lock-file-mode%29%29" class="RktValLink" data-pltdoc="x">preferences-lock-file-mode</a></span> returns
<span class="RktVal">'</span><span class="RktVal">file-lock</span> and when <span class="RktVar">use-lock?</span> is true,
preference-file reading is guarded by a lock; multiple readers can
share the lock, but writers take the lock exclusively. If the
preferences file cannot be read because the lock is unavailable,
<span class="RktVar">lock-there</span> is called on the path of the lock file; if
<span class="RktVar">lock-there</span> is <span class="RktVal">#f</span>, an exception is raised. The
default <span class="RktVar">lock-there</span> handler retries about 5 times (with
increasing delays between each attempt) before trying
<span class="RktVar">timeout-lock-there</span>, and the default <span class="RktVar">timeout-lock-there</span>
triggers an exception.</p><p>See also <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._put-preferences%29%29" class="RktValLink" data-pltdoc="x">put-preferences</a></span>. For a more elaborate preference
system, see <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=framework&rel=Preferences__Textual.html%23%2528def._%2528%2528lib._framework%252Fpreferences..rkt%2529._preferences%7E3aget%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">preferences:get</a></span>.</p><p><a name="(elem._old-prefs)"></a><span style="font-weight: bold">Old preferences files</span>: When a
<span class="RktVar">filename</span> is not provided and the file indicated by
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValLink" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">pref-file</span><span class="RktPn">)</span> does not exist, the following
paths are checked for compatibility with old versions of Racket:</p><ul><li><p>Windows: <span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._build-path%29%29" class="RktValLink" data-pltdoc="x">build-path</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValLink" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">pref-dir</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">up</span><span class="stt"> </span><span class="RktVal">"PLT Scheme"</span><span class="stt"> </span><span class="RktVal">"plt-prefs.ss"</span><span class="RktPn">)</span></p></li><li><p>Mac OS X: <span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._build-path%29%29" class="RktValLink" data-pltdoc="x">build-path</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValLink" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">pref-dir</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktVal">"org.plt-scheme.prefs.ss"</span><span class="RktPn">)</span></p></li><li><p>Unix: <span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._expand-user-path%29%29" class="RktValLink" data-pltdoc="x">expand-user-path</a></span><span class="stt"> </span><span class="RktVal">"~/.plt-scheme/plt-prefs.ss"</span><span class="RktPn">)</span></p></li></ul><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._put-preferences))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._put-preferences%29%29" class="RktValDef RktValLink" data-pltdoc="x">put-preferences</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">names</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">vals</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">locked-proc</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">filename</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">names</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">vals</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" class="RktValLink" data-pltdoc="x">list?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">locked-proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">filename</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Installs a set of preference values and writes all current values to
the preference file designated by <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29" class="RktValLink" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">pref-file</span><span class="RktPn">)</span>, or <span class="RktVar">filename</span> if it is supplied and not
<span class="RktVal">#f</span>.</div></p><p>The <span class="RktVar">names</span> argument supplies the preference names, and
<span class="RktVar">vals</span> must have the same length as <span class="RktVar">names</span>. Each
element of <span class="RktVar">vals</span> must be an instance of a built-in data type
whose <span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._write%29%29" class="RktValLink" data-pltdoc="x">write</a></span> output is <span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read%29%29" class="RktValLink" data-pltdoc="x">read</a></span>able (i.e., the
<span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._print-unreadable%29%29" class="RktValLink" data-pltdoc="x">print-unreadable</a></span> parameter is set to <span class="RktVal">#f</span> while
writing preferences).</p><p>Current preference values are read from the preference file before
updating, and a write lock is held starting before the file
read, and lasting until after the preferences file is updated. The
lock is implemented by the existence of a file in the same directory
as the preference file; see <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._preferences-lock-file-mode%29%29" class="RktValLink" data-pltdoc="x">preferences-lock-file-mode</a></span> for
more information. If the directory of the preferences file does
not already exist, it is created.</p><p>If the write lock is already held, then
<span class="RktVar">locked-proc</span> is called with a single argument: the path of the lock
file. The default <span class="RktVar">locked-proc</span> (used when the <span class="RktVar">locked-proc</span>
argument is <span class="RktVal">#f</span>) reports an error; an alternative
thunk might wait a while and try again, or give the user the choice to
delete the lock file (in case a previous update attempt encountered
disaster and locks are implemented by the presence of the lock file).</p><p>If <span class="RktVar">filename</span> is <span class="RktVal">#f</span> or not supplied, and the
preference file does not already exist, then values read from the
<span class="stt">"defaults"</span> collection (if any) are written for preferences
that are not mentioned in <span class="RktVar">names</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._preferences-lock-file-mode))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._preferences-lock-file-mode%29%29" class="RktValDef RktValLink" data-pltdoc="x">preferences-lock-file-mode</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">exists</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">file-lock</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Reports the way that the lock file is used to implement
preference-file locking on the current platform.</div></p><p>The <span class="RktVal">'</span><span class="RktVal">exists</span> mode is currently used on all platforms except
Windows. In <span class="RktVal">'</span><span class="RktVal">exists</span> mode, the existence of the lock file
indicates that a write lock is held, and readers need no lock (because
the preferences file is atomically updated via
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._rename-file-or-directory%29%29" class="RktValLink" data-pltdoc="x">rename-file-or-directory</a></span>).</p><p>The <span class="RktVal">'</span><span class="RktVal">file-lock</span> mode is currently used on Windows. In
<span class="RktVal">'</span><span class="RktVal">file-lock</span> mode, shared and exclusive locks (in the sense of
<span class="RktSym"><a href="file-ports.html#%28def._%28%28quote._~23~25kernel%29._port-try-file-lock~3f%29%29" class="RktValLink" data-pltdoc="x">port-try-file-lock?</a></span>) on the lock file reflect reader and
writer locks on the preference-file content. (The preference file
itself is not locked, because a lock would interfere with replacing
the file via <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._rename-file-or-directory%29%29" class="RktValLink" data-pltdoc="x">rename-file-or-directory</a></span>.)</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._make-handle-get-preference-locked))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-handle-get-preference-locked%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-handle-get-preference-locked</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">delay</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">name</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">failure-thunk</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">flush-mode</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">filename</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:lock-there</span><span class="hspace"> </span><span class="RktVar">lock-there</span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:max-delay</span><span class="hspace"> </span><span class="RktVar">max-delay</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">delay</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">failure-thunk</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">flush-mode</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">timestamp</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">filename</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">lock-there</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">max-delay</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0.2</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a procedure suitable for use as the <span class="RktPn">#:lock-there</span>
argument to <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._get-preference%29%29" class="RktValLink" data-pltdoc="x">get-preference</a></span>, where the <span class="RktVar">name</span>,
<span class="RktVar">failure-thunk</span>, <span class="RktVar">flush-mode</span>, and <span class="RktVar">filename</span>
are all passed on to <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._get-preference%29%29" class="RktValLink" data-pltdoc="x">get-preference</a></span> by the result procedure
to retry the preferences lookup.</div></p><p>Before calling <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._get-preference%29%29" class="RktValLink" data-pltdoc="x">get-preference</a></span>, the result procedure uses
<span class="RktPn">(</span><span class="RktSym"><a href="threads.html#%28def._%28%28quote._~23~25kernel%29._sleep%29%29" class="RktValLink" data-pltdoc="x">sleep</a></span><span class="stt"> </span><span class="RktVar">delay</span><span class="RktPn">)</span> to pause. Then, if <span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2A%29%29" class="RktValLink" data-pltdoc="x">*</a></span><span class="stt"> </span><span class="RktVal">2</span><span class="stt"> </span><span class="RktVar">delay</span><span class="RktPn">)</span> is less
than <span class="RktVar">max-delay</span>, the result procedure calls
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-handle-get-preference-locked%29%29" class="RktValLink" data-pltdoc="x">make-handle-get-preference-locked</a></span> to generate a new retry
procedure to pass to <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._get-preference%29%29" class="RktValLink" data-pltdoc="x">get-preference</a></span>, but with a
<span class="RktVar">delay</span> of <span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2A%29%29" class="RktValLink" data-pltdoc="x">*</a></span><span class="stt"> </span><span class="RktVal">2</span><span class="stt"> </span><span class="RktVar">delay</span><span class="RktPn">)</span>. If <span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2A%29%29" class="RktValLink" data-pltdoc="x">*</a></span><span class="stt"> </span><span class="RktVal">2</span><span class="stt"> </span><span class="RktVar">delay</span><span class="RktPn">)</span> is not
less than <span class="RktVar">max-delay</span>, then <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._get-preference%29%29" class="RktValLink" data-pltdoc="x">get-preference</a></span> is called
with the given <span class="RktVar">lock-there</span>, instead.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._call-with-file-lock/timeout))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-file-lock%2Ftimeout%29%29" class="RktValDef RktValLink" data-pltdoc="x">call-with-file-lock/timeout</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">filename</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">kind</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">thunk</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktVar">failure-thunk</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:lock-file</span><span class="hspace"> </span><span class="RktVar">lock-file</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:delay</span><span class="hspace"> </span><span class="RktVar">delay</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:max-delay</span><span class="hspace"> </span><span class="RktVar">max-delay</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">filename</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">kind</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">shared</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">exclusive</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">thunk</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">failure-thunk</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">lock-file</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">delay</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._not%2Fc%29%29" class="RktValLink" data-pltdoc="x">not/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._negative~3f%29%29" class="RktValLink" data-pltdoc="x">negative?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0.01</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">max-delay</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._real~3f%29%29" class="RktValLink" data-pltdoc="x">real?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._not%2Fc%29%29" class="RktValLink" data-pltdoc="x">not/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._negative~3f%29%29" class="RktValLink" data-pltdoc="x">negative?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0.2</span></td></tr></table></blockquote></div><div class="SIntrapara">Obtains a lock for the filename <span class="RktVar">lock-file</span> and then calls
<span class="RktVar">thunk</span>. The <span class="RktVar">filename</span> argument specifies a file path
prefix that is used only to generate the lock filename when
<span class="RktVar">lock-file</span> is <span class="RktVal">#f</span>. Specifically, when
<span class="RktVar">lock-file</span> is <span class="RktVal">#f</span>, then
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-file-lock%2Ftimeout%29%29" class="RktValLink" data-pltdoc="x">call-with-file-lock/timeout</a></span> uses <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-lock-file-name%29%29" class="RktValLink" data-pltdoc="x">make-lock-file-name</a></span>
to build the lock filename. If the lock file does not yet exist, it is
created; beware that the lock file is <span style="font-style: italic">not</span> deleted by
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-file-lock%2Ftimeout%29%29" class="RktValLink" data-pltdoc="x">call-with-file-lock/timeout</a></span>.</div></p><p>When <span class="RktVar">thunk</span> returns,
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-file-lock%2Ftimeout%29%29" class="RktValLink" data-pltdoc="x">call-with-file-lock/timeout</a></span> releases the lock, returning the result of
<span class="RktVar">thunk</span>. The <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-file-lock%2Ftimeout%29%29" class="RktValLink" data-pltdoc="x">call-with-file-lock/timeout</a></span> function will retry
after <span class="RktVar">delay</span> seconds and continue retrying with exponential backoff
until delay reaches <span class="RktVar">max-delay</span>. If
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-file-lock%2Ftimeout%29%29" class="RktValLink" data-pltdoc="x">call-with-file-lock/timeout</a></span> fails to obtain the lock,
<span class="RktVar">failure-thunk</span> is called in tail position. The <span class="RktVar">kind</span> argument
specifies whether the lock is <span class="RktVal">'</span><span class="RktVal">shared</span> or <span class="RktVal">'</span><span class="RktVal">exclusive</span>
in the sense of <span class="RktSym"><a href="file-ports.html#%28def._%28%28quote._~23~25kernel%29._port-try-file-lock~3f%29%29" class="RktValLink" data-pltdoc="x">port-try-file-lock?</a></span>.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-file-lock%2Ftimeout%29%29" class="RktValLink" data-pltdoc="x">call-with-file-lock/timeout</a></span><span class="hspace"> </span><span class="RktSym">filename</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">exclusive</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._printf%29%29" class="RktValLink" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">"File is locked\n"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._printf%29%29" class="RktValLink" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">"Failed to obtain lock for file\n"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktOut">File is locked</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-file-lock%2Ftimeout%29%29" class="RktValLink" data-pltdoc="x">call-with-file-lock/timeout</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">exclusive</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._call-with-file-lock%2Ftimeout%29%29" class="RktValLink" data-pltdoc="x">call-with-file-lock/timeout</a></span><span class="hspace"> </span><span class="RktSym">filename</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">shared</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._printf%29%29" class="RktValLink" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">"Shouldn't get here\n"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._printf%29%29" class="RktValLink" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">"Failed to obtain lock for file\n"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._printf%29%29" class="RktValLink" data-pltdoc="x">printf</a></span><span class="hspace"> </span><span class="RktVal">"Shouldn't get here either\n"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">#:lock-file</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-lock-file-name%29%29" class="RktValLink" data-pltdoc="x">make-lock-file-name</a></span><span class="hspace"> </span><span class="RktSym">filename</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktOut">Failed to obtain lock for file</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/file..rkt)._make-lock-file-name))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-lock-file-name%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-lock-file-name</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path-for-some-system~3f%29%29" class="RktValLink" data-pltdoc="x">path-for-some-system?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-lock-file-name%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-lock-file-name</a></span></span><span class="hspace"> </span><span class="RktVar">dir</span><span class="hspace"> </span><span class="RktVar">name</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">dir</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29" class="RktValLink" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path-for-some-system~3f%29%29" class="RktValLink" data-pltdoc="x">path-for-some-system?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="More_Path_Utilities.html#%28def._%28%28lib._racket%2Fpath..rkt%29._path-element~3f%29%29" class="RktValLink" data-pltdoc="x">path-element?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a lock filename by prepending <span class="RktVal">"_LOCK"</span> on Windows or
<span class="RktVal">".LOCK"</span> on other platforms to the file portion of the path.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Example:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._make-lock-file-name%29%29" class="RktValLink" data-pltdoc="x">make-lock-file-name</a></span><span class="hspace"> </span><span class="RktVal">"/home/george/project/important-file"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#<path:/home/george/project/.LOCKimportant-file></span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/file..rkt)._user-read-bit))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._user-read-bit%29%29" class="RktValDef RktValLink" data-pltdoc="x">user-read-bit</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#o400</span></p></blockquote></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/file..rkt)._user-write-bit))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._user-write-bit%29%29" class="RktValDef RktValLink" data-pltdoc="x">user-write-bit</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#o200</span></p></blockquote></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/file..rkt)._user-execute-bit))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._user-execute-bit%29%29" class="RktValDef RktValLink" data-pltdoc="x">user-execute-bit</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#o100</span></p></blockquote></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/file..rkt)._group-read-bit))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._group-read-bit%29%29" class="RktValDef RktValLink" data-pltdoc="x">group-read-bit</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#o040</span></p></blockquote></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/file..rkt)._group-write-bit))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._group-write-bit%29%29" class="RktValDef RktValLink" data-pltdoc="x">group-write-bit</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#o020</span></p></blockquote></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/file..rkt)._group-execute-bit))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._group-execute-bit%29%29" class="RktValDef RktValLink" data-pltdoc="x">group-execute-bit</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#o010</span></p></blockquote></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/file..rkt)._other-read-bit))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._other-read-bit%29%29" class="RktValDef RktValLink" data-pltdoc="x">other-read-bit</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#o004</span></p></blockquote></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/file..rkt)._other-write-bit))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._other-write-bit%29%29" class="RktValDef RktValLink" data-pltdoc="x">other-write-bit</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#o002</span></p></blockquote></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._racket/file..rkt)._other-execute-bit))"></a><span title="Provided from: racket/file, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Ffile..rkt%29._other-execute-bit%29%29" class="RktValDef RktValLink" data-pltdoc="x">other-execute-bit</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">#o001</span></p></blockquote></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Constants that are useful with <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._file-or-directory-permissions%29%29" class="RktValLink" data-pltdoc="x">file-or-directory-permissions</a></span>
and bitwise operations such as <span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._bitwise-ior%29%29" class="RktValLink" data-pltdoc="x">bitwise-ior</a></span>, and
<span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._bitwise-and%29%29" class="RktValLink" data-pltdoc="x">bitwise-and</a></span>.</div></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="windowspaths.html" title="backward to "15.1.4 Windows Path Conventions"" data-pltdoc="x">← prev</a> <a href="os.html" title="up to "15 Operating System"" data-pltdoc="x">up</a> <a href="networking.html" title="forward to "15.3 Networking"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|