source: project/wiki/eggref/4/with-current-directory @ 36801

Last change on this file since 36801 was 36801, checked in by evhan, 11 months ago

wiki/eggref: update docs/formatting/urls and eggref/5/{r7rs,fancypants,chicken-belt}

File size: 899 bytes
Line 
1[[tags: egg]]
2
3== with-current-directory
4
5[[toc:]]
6
7== Description
8
9Convenience procedure for temporarily changing directories.
10
11The source for this extension is available [[https://git.foldling.org/chicken-with-current-directory.git|here]].
12
13== Usage
14
15<procedure>(with-current-directory path thunk)</procedure>
16
17Changes directory to the given {{path}}, calls {{thunk}}, and restores
18the original working directory afterwards.
19
20Note that '''this procedure is not thread-safe'''. The current directory
21is a process-level value, and this extension makes no attempt to
22preserve thread-specific working directories across interrupts. If the
23calling thread is preempted or yields before the thunk's body returns,
24the given path will persist as the process's current working directory
25at least until the calling thread is resumed.
26
27== Author
28
29[[/users/evan-hanson|Evan Hanson]]
30
31== License
32
33Public Domain
Note: See TracBrowser for help on using the repository browser.