home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 53 74 61 6e 64 61 72 |\section|{Standar|
|00000010| 64 20 4d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |d Module| \sectco|
|00000020| 64 65 7b 6f 73 7d 7d 0a | 0a 5c 73 74 6d 6f 64 69 |de{os}}.|.\stmodi|
|00000030| 6e 64 65 78 7b 6f 73 7d | 0a 54 68 69 73 20 6d 6f |ndex{os}|.This mo|
|00000040| 64 75 6c 65 20 70 72 6f | 76 69 64 65 73 20 61 20 |dule pro|vides a |
|00000050| 6d 6f 72 65 20 70 6f 72 | 74 61 62 6c 65 20 77 61 |more por|table wa|
|00000060| 79 20 6f 66 20 75 73 69 | 6e 67 20 6f 70 65 72 61 |y of usi|ng opera|
|00000070| 74 69 6e 67 20 73 79 73 | 74 65 6d 0a 28 4f 53 29 |ting sys|tem.(OS)|
|00000080| 20 64 65 70 65 6e 64 65 | 6e 74 20 66 75 6e 63 74 | depende|nt funct|
|00000090| 69 6f 6e 61 6c 69 74 79 | 20 74 68 61 6e 20 69 6d |ionality| than im|
|000000a0| 70 6f 72 74 69 6e 67 20 | 61 6e 20 4f 53 20 64 65 |porting |an OS de|
|000000b0| 70 65 6e 64 65 6e 74 20 | 62 75 69 6c 74 2d 69 6e |pendent |built-in|
|000000c0| 0a 6d 6f 64 75 6c 65 20 | 6c 69 6b 65 20 5c 63 6f |.module |like \co|
|000000d0| 64 65 7b 70 6f 73 69 78 | 7d 2e 0a 0a 57 68 65 6e |de{posix|}...When|
|000000e0| 20 74 68 65 20 6f 70 74 | 69 6f 6e 61 6c 20 62 75 | the opt|ional bu|
|000000f0| 69 6c 74 2d 69 6e 20 6d | 6f 64 75 6c 65 20 5c 63 |ilt-in m|odule \c|
|00000100| 6f 64 65 7b 70 6f 73 69 | 78 7d 20 69 73 20 61 76 |ode{posi|x} is av|
|00000110| 61 69 6c 61 62 6c 65 2c | 20 74 68 69 73 0a 6d 6f |ailable,| this.mo|
|00000120| 64 75 6c 65 20 65 78 70 | 6f 72 74 73 20 74 68 65 |dule exp|orts the|
|00000130| 20 73 61 6d 65 20 66 75 | 6e 63 74 69 6f 6e 73 20 | same fu|nctions |
|00000140| 61 6e 64 20 64 61 74 61 | 20 61 73 20 5c 63 6f 64 |and data| as \cod|
|00000150| 65 7b 70 6f 73 69 78 7d | 3b 20 6f 74 68 65 72 77 |e{posix}|; otherw|
|00000160| 69 73 65 2c 0a 69 74 20 | 73 65 61 72 63 68 65 73 |ise,.it |searches|
|00000170| 20 66 6f 72 20 61 6e 20 | 4f 53 20 64 65 70 65 6e | for an |OS depen|
|00000180| 64 65 6e 74 20 62 75 69 | 6c 74 2d 69 6e 20 6d 6f |dent bui|lt-in mo|
|00000190| 64 75 6c 65 20 6c 69 6b | 65 20 5c 63 6f 64 65 7b |dule lik|e \code{|
|000001a0| 6d 61 63 7d 20 61 6e 64 | 0a 65 78 70 6f 72 74 73 |mac} and|.exports|
|000001b0| 20 74 68 65 20 73 61 6d | 65 20 66 75 6e 63 74 69 | the sam|e functi|
|000001c0| 6f 6e 73 20 61 6e 64 20 | 64 61 74 61 20 61 73 20 |ons and |data as |
|000001d0| 66 6f 75 6e 64 20 74 68 | 65 72 65 2e 20 20 54 68 |found th|ere. Th|
|000001e0| 65 20 64 65 73 69 67 6e | 20 6f 66 20 61 6c 6c 0a |e design| of all.|
|000001f0| 50 79 74 68 6f 6e 27 73 | 20 62 75 69 6c 74 2d 69 |Python's| built-i|
|00000200| 6e 20 4f 53 20 64 65 70 | 65 6e 64 65 6e 74 20 6d |n OS dep|endent m|
|00000210| 6f 64 75 6c 65 73 20 69 | 73 20 73 75 63 68 20 74 |odules i|s such t|
|00000220| 68 61 74 20 61 73 20 6c | 6f 6e 67 20 61 73 20 74 |hat as l|ong as t|
|00000230| 68 65 20 73 61 6d 65 0a | 66 75 6e 63 74 69 6f 6e |he same.|function|
|00000240| 61 6c 69 74 79 20 69 73 | 20 61 76 61 69 6c 61 62 |ality is| availab|
|00000250| 6c 65 2c 20 69 74 20 75 | 73 65 73 20 74 68 65 20 |le, it u|ses the |
|00000260| 73 61 6d 65 20 69 6e 74 | 65 72 66 61 63 65 3b 20 |same int|erface; |
|00000270| 65 2e 67 2e 2c 20 74 68 | 65 0a 66 75 6e 63 74 69 |e.g., th|e.functi|
|00000280| 6f 6e 20 5c 63 6f 64 65 | 7b 6f 73 2e 73 74 61 74 |on \code|{os.stat|
|00000290| 28 5c 76 61 72 7b 66 69 | 6c 65 7d 29 7d 20 72 65 |(\var{fi|le})} re|
|000002a0| 74 75 72 6e 73 20 73 74 | 61 74 20 69 6e 66 6f 20 |turns st|at info |
|000002b0| 61 62 6f 75 74 20 61 20 | 5c 76 61 72 7b 66 69 6c |about a |\var{fil|
|000002c0| 65 7d 20 69 6e 20 61 0a | 66 6f 72 6d 61 74 20 63 |e} in a.|format c|
|000002d0| 6f 6d 70 61 74 69 62 6c | 65 20 77 69 74 68 20 74 |ompatibl|e with t|
|000002e0| 68 65 20 50 4f 53 49 58 | 20 69 6e 74 65 72 66 61 |he POSIX| interfa|
|000002f0| 63 65 2e 0a 0a 45 78 74 | 65 6e 73 69 6f 6e 73 20 |ce...Ext|ensions |
|00000300| 70 65 63 75 6c 69 61 72 | 20 74 6f 20 61 20 70 61 |peculiar| to a pa|
|00000310| 72 74 69 63 75 6c 61 72 | 20 4f 53 20 61 72 65 20 |rticular| OS are |
|00000320| 61 6c 73 6f 20 61 76 61 | 69 6c 61 62 6c 65 20 74 |also ava|ilable t|
|00000330| 68 72 6f 75 67 68 20 74 | 68 65 0a 5c 63 6f 64 65 |hrough t|he.\code|
|00000340| 7b 6f 73 7d 20 6d 6f 64 | 75 6c 65 2c 20 62 75 74 |{os} mod|ule, but|
|00000350| 20 75 73 69 6e 67 20 74 | 68 65 6d 20 69 73 20 6f | using t|hem is o|
|00000360| 66 20 63 6f 75 72 73 65 | 20 61 20 74 68 72 65 61 |f course| a threa|
|00000370| 74 20 74 6f 20 70 6f 72 | 74 61 62 69 6c 69 74 79 |t to por|tability|
|00000380| 21 0a 0a 4e 6f 74 65 20 | 74 68 61 74 20 61 66 74 |!..Note |that aft|
|00000390| 65 72 20 74 68 65 20 66 | 69 72 73 74 20 74 69 6d |er the f|irst tim|
|000003a0| 65 20 5c 63 6f 64 65 7b | 6f 73 7d 20 69 73 20 69 |e \code{|os} is i|
|000003b0| 6d 70 6f 72 74 65 64 2c | 20 74 68 65 72 65 20 69 |mported,| there i|
|000003c0| 73 20 5c 65 6d 70 68 7b | 6e 6f 7d 0a 70 65 72 66 |s \emph{|no}.perf|
|000003d0| 6f 72 6d 61 6e 63 65 20 | 70 65 6e 61 6c 74 79 20 |ormance |penalty |
|000003e0| 69 6e 20 75 73 69 6e 67 | 20 66 75 6e 63 74 69 6f |in using| functio|
|000003f0| 6e 73 20 66 72 6f 6d 20 | 5c 63 6f 64 65 7b 6f 73 |ns from |\code{os|
|00000400| 7d 20 69 6e 73 74 65 61 | 64 20 6f 66 0a 64 69 72 |} instea|d of.dir|
|00000410| 65 63 74 6c 79 20 66 72 | 6f 6d 20 74 68 65 20 4f |ectly fr|om the O|
|00000420| 53 20 64 65 70 65 6e 64 | 65 6e 74 20 62 75 69 6c |S depend|ent buil|
|00000430| 74 2d 69 6e 20 6d 6f 64 | 75 6c 65 2c 20 73 6f 20 |t-in mod|ule, so |
|00000440| 74 68 65 72 65 20 73 68 | 6f 75 6c 64 20 62 65 0a |there sh|ould be.|
|00000450| 5c 65 6d 70 68 7b 6e 6f | 7d 20 72 65 61 73 6f 6e |\emph{no|} reason|
|00000460| 20 6e 6f 74 20 74 6f 20 | 75 73 65 20 5c 63 6f 64 | not to |use \cod|
|00000470| 65 7b 6f 73 7d 21 0a 0a | 49 6e 20 61 64 64 69 74 |e{os}!..|In addit|
|00000480| 69 6f 6e 20 74 6f 20 77 | 68 61 74 65 76 65 72 20 |ion to w|hatever |
|00000490| 74 68 65 20 63 6f 72 72 | 65 63 74 20 4f 53 20 64 |the corr|ect OS d|
|000004a0| 65 70 65 6e 64 65 6e 74 | 20 6d 6f 64 75 6c 65 20 |ependent| module |
|000004b0| 65 78 70 6f 72 74 73 2c | 20 74 68 65 0a 66 6f 6c |exports,| the.fol|
|000004c0| 6c 6f 77 69 6e 67 20 76 | 61 72 69 61 62 6c 65 73 |lowing v|ariables|
|000004d0| 20 61 6e 64 20 66 75 6e | 63 74 69 6f 6e 73 20 61 | and fun|ctions a|
|000004e0| 72 65 20 61 6c 77 61 79 | 73 20 65 78 70 6f 72 74 |re alway|s export|
|000004f0| 65 64 20 62 79 20 5c 63 | 6f 64 65 7b 6f 73 7d 3a |ed by \c|ode{os}:|
|00000500| 0a 0a 5c 72 65 6e 65 77 | 63 6f 6d 6d 61 6e 64 7b |..\renew|command{|
|00000510| 5c 69 6e 64 65 78 73 75 | 62 69 74 65 6d 7d 7b 28 |\indexsu|bitem}{(|
|00000520| 69 6e 20 6d 6f 64 75 6c | 65 20 6f 73 29 7d 0a 0a |in modul|e os)}..|
|00000530| 5c 62 65 67 69 6e 7b 64 | 61 74 61 64 65 73 63 7d |\begin{d|atadesc}|
|00000540| 7b 6e 61 6d 65 7d 0a 54 | 68 65 20 6e 61 6d 65 20 |{name}.T|he name |
|00000550| 6f 66 20 74 68 65 20 4f | 53 20 64 65 70 65 6e 64 |of the O|S depend|
|00000560| 65 6e 74 20 6d 6f 64 75 | 6c 65 20 69 6d 70 6f 72 |ent modu|le impor|
|00000570| 74 65 64 2e 20 20 54 68 | 65 20 66 6f 6c 6c 6f 77 |ted. Th|e follow|
|00000580| 69 6e 67 20 6e 61 6d 65 | 73 0a 68 61 76 65 20 63 |ing name|s.have c|
|00000590| 75 72 72 65 6e 74 6c 79 | 20 62 65 65 6e 20 72 65 |urrently| been re|
|000005a0| 67 69 73 74 65 72 65 64 | 3a 20 5c 63 6f 64 65 7b |gistered|: \code{|
|000005b0| 27 70 6f 73 69 78 27 7d | 2c 20 5c 63 6f 64 65 7b |'posix'}|, \code{|
|000005c0| 27 6e 74 27 7d 2c 0a 5c | 63 6f 64 65 7b 27 64 6f |'nt'},.\|code{'do|
|000005d0| 73 27 7d 2c 20 5c 63 6f | 64 65 7b 27 6d 61 63 27 |s'}, \co|de{'mac'|
|000005e0| 7d 2e 0a 5c 65 6e 64 7b | 64 61 74 61 64 65 73 63 |}..\end{|datadesc|
|000005f0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 64 61 74 61 64 65 |}..\begi|n{datade|
|00000600| 73 63 7d 7b 70 61 74 68 | 7d 0a 54 68 65 20 63 6f |sc}{path|}.The co|
|00000610| 72 72 65 73 70 6f 6e 64 | 69 6e 67 20 4f 53 20 64 |rrespond|ing OS d|
|00000620| 65 70 65 6e 64 65 6e 74 | 20 73 74 61 6e 64 61 72 |ependent| standar|
|00000630| 64 20 6d 6f 64 75 6c 65 | 20 66 6f 72 20 70 61 74 |d module| for pat|
|00000640| 68 6e 61 6d 65 0a 6f 70 | 65 72 61 74 69 6f 6e 73 |hname.op|erations|
|00000650| 2c 20 65 2e 67 2e 2c 20 | 5c 63 6f 64 65 7b 70 6f |, e.g., |\code{po|
|00000660| 73 69 78 70 61 74 68 7d | 20 6f 72 20 5c 63 6f 64 |sixpath}| or \cod|
|00000670| 65 7b 6d 61 63 70 61 74 | 68 7d 2e 20 20 54 68 75 |e{macpat|h}. Thu|
|00000680| 73 2c 20 28 67 69 76 65 | 6e 0a 74 68 65 20 70 72 |s, (give|n.the pr|
|00000690| 6f 70 65 72 20 69 6d 70 | 6f 72 74 73 29 2c 20 5c |oper imp|orts), \|
|000006a0| 63 6f 64 65 7b 6f 73 2e | 70 61 74 68 2e 73 70 6c |code{os.|path.spl|
|000006b0| 69 74 28 5c 76 61 72 7b | 66 69 6c 65 7d 29 7d 20 |it(\var{|file})} |
|000006c0| 69 73 20 65 71 75 69 76 | 61 6c 65 6e 74 20 74 6f |is equiv|alent to|
|000006d0| 20 62 75 74 0a 6d 6f 72 | 65 20 70 6f 72 74 61 62 | but.mor|e portab|
|000006e0| 6c 65 20 74 68 61 6e 20 | 5c 63 6f 64 65 7b 70 6f |le than |\code{po|
|000006f0| 73 69 78 70 61 74 68 2e | 73 70 6c 69 74 28 5c 76 |sixpath.|split(\v|
|00000700| 61 72 7b 66 69 6c 65 7d | 29 7d 2e 0a 5c 65 6e 64 |ar{file}|)}..\end|
|00000710| 7b 64 61 74 61 64 65 73 | 63 7d 0a 0a 5c 62 65 67 |{datades|c}..\beg|
|00000720| 69 6e 7b 64 61 74 61 64 | 65 73 63 7d 7b 63 75 72 |in{datad|esc}{cur|
|00000730| 64 69 72 7d 0a 54 68 65 | 20 63 6f 6e 73 74 61 6e |dir}.The| constan|
|00000740| 74 20 73 74 72 69 6e 67 | 20 75 73 65 64 20 62 79 |t string| used by|
|00000750| 20 74 68 65 20 4f 53 20 | 74 6f 20 72 65 66 65 72 | the OS |to refer|
|00000760| 20 74 6f 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | to the |current |
|00000770| 64 69 72 65 63 74 6f 72 | 79 2c 0a 65 2e 67 2e 20 |director|y,.e.g. |
|00000780| 5c 63 6f 64 65 7b 27 2e | 27 7d 20 66 6f 72 20 50 |\code{'.|'} for P|
|00000790| 4f 53 49 58 20 6f 72 20 | 5c 63 6f 64 65 7b 27 3a |OSIX or |\code{':|
|000007a0| 27 7d 20 66 6f 72 20 74 | 68 65 20 4d 61 63 2e 0a |'} for t|he Mac..|
|000007b0| 5c 65 6e 64 7b 64 61 74 | 61 64 65 73 63 7d 0a 0a |\end{dat|adesc}..|
|000007c0| 5c 62 65 67 69 6e 7b 64 | 61 74 61 64 65 73 63 7d |\begin{d|atadesc}|
|000007d0| 7b 70 61 72 64 69 72 7d | 0a 54 68 65 20 63 6f 6e |{pardir}|.The con|
|000007e0| 73 74 61 6e 74 20 73 74 | 72 69 6e 67 20 75 73 65 |stant st|ring use|
|000007f0| 64 20 62 79 20 74 68 65 | 20 4f 53 20 74 6f 20 72 |d by the| OS to r|
|00000800| 65 66 65 72 20 74 6f 20 | 74 68 65 20 70 61 72 65 |efer to |the pare|
|00000810| 6e 74 20 64 69 72 65 63 | 74 6f 72 79 2c 0a 65 2e |nt direc|tory,.e.|
|00000820| 67 2e 20 5c 63 6f 64 65 | 7b 27 2e 2e 27 7d 20 66 |g. \code|{'..'} f|
|00000830| 6f 72 20 50 4f 53 49 58 | 20 6f 72 20 5c 63 6f 64 |or POSIX| or \cod|
|00000840| 65 7b 27 3a 3a 27 7d 20 | 66 6f 72 20 74 68 65 20 |e{'::'} |for the |
|00000850| 4d 61 63 2e 0a 5c 65 6e | 64 7b 64 61 74 61 64 65 |Mac..\en|d{datade|
|00000860| 73 63 7d 0a 0a 5c 62 65 | 67 69 6e 7b 64 61 74 61 |sc}..\be|gin{data|
|00000870| 64 65 73 63 7d 7b 73 65 | 70 7d 0a 54 68 65 20 63 |desc}{se|p}.The c|
|00000880| 68 61 72 61 63 74 65 72 | 20 75 73 65 64 20 62 79 |haracter| used by|
|00000890| 20 74 68 65 20 4f 53 20 | 74 6f 20 73 65 70 61 72 | the OS |to separ|
|000008a0| 61 74 65 20 70 61 74 68 | 6e 61 6d 65 20 63 6f 6d |ate path|name com|
|000008b0| 70 6f 6e 65 6e 74 73 2c | 20 65 2e 67 2e 5c 0a 5c |ponents,| e.g.\.\|
|000008c0| 63 6f 64 65 7b 27 2f 27 | 7d 20 66 6f 72 20 50 4f |code{'/'|} for PO|
|000008d0| 53 49 58 20 6f 72 20 5c | 63 6f 64 65 7b 27 3a 27 |SIX or \|code{':'|
|000008e0| 7d 20 66 6f 72 20 74 68 | 65 20 4d 61 63 2e 20 20 |} for th|e Mac. |
|000008f0| 4e 6f 74 65 20 74 68 61 | 74 20 6b 6e 6f 77 69 6e |Note tha|t knowin|
|00000900| 67 20 74 68 69 73 0a 69 | 73 20 6e 6f 74 20 73 75 |g this.i|s not su|
|00000910| 66 66 69 63 69 65 6e 74 | 20 74 6f 20 62 65 20 61 |fficient| to be a|
|00000920| 62 6c 65 20 74 6f 20 70 | 61 72 73 65 20 6f 72 20 |ble to p|arse or |
|00000930| 63 6f 6e 63 61 74 65 6e | 61 74 65 20 70 61 74 68 |concaten|ate path|
|00000940| 6e 61 6d 65 73 2d 2d 2d | 62 65 74 74 65 72 0a 75 |names---|better.u|
|00000950| 73 65 20 5c 63 6f 64 65 | 7b 6f 73 2e 70 61 74 68 |se \code|{os.path|
|00000960| 2e 73 70 6c 69 74 28 29 | 7d 20 61 6e 64 20 5c 63 |.split()|} and \c|
|00000970| 6f 64 65 7b 6f 73 2e 70 | 61 74 68 2e 6a 6f 69 6e |ode{os.p|ath.join|
|00000980| 28 29 7d 2d 2d 2d 62 75 | 74 20 69 74 20 69 73 0a |()}---bu|t it is.|
|00000990| 6f 63 63 61 73 69 6f 6e | 61 6c 6c 79 20 75 73 65 |occasion|ally use|
|000009a0| 66 75 6c 2e 0a 5c 65 6e | 64 7b 64 61 74 61 64 65 |ful..\en|d{datade|
|000009b0| 73 63 7d 0a 0a 5c 62 65 | 67 69 6e 7b 64 61 74 61 |sc}..\be|gin{data|
|000009c0| 64 65 73 63 7d 7b 70 61 | 74 68 73 65 70 7d 0a 54 |desc}{pa|thsep}.T|
|000009d0| 68 65 20 63 68 61 72 61 | 63 74 65 72 20 63 6f 6e |he chara|cter con|
|000009e0| 76 65 6e 74 69 6f 6e 61 | 6c 6c 79 20 75 73 65 64 |ventiona|lly used|
|000009f0| 20 62 79 20 74 68 65 20 | 4f 53 20 74 6f 20 73 65 | by the |OS to se|
|00000a00| 70 61 72 61 74 65 20 73 | 65 61 72 63 68 20 70 61 |parate s|earch pa|
|00000a10| 74 63 68 0a 63 6f 6d 70 | 6f 6e 65 6e 74 73 20 28 |tch.comp|onents (|
|00000a20| 61 73 20 69 6e 20 5c 63 | 6f 64 65 7b 5c 24 50 41 |as in \c|ode{\$PA|
|00000a30| 54 48 7d 29 2c 20 65 2e | 67 2e 5c 20 5c 63 6f 64 |TH}), e.|g.\ \cod|
|00000a40| 65 7b 27 3a 27 7d 20 66 | 6f 72 20 50 4f 53 49 58 |e{':'} f|or POSIX|
|00000a50| 20 6f 72 0a 5c 63 6f 64 | 65 7b 27 3b 27 7d 20 66 | or.\cod|e{';'} f|
|00000a60| 6f 72 20 4d 53 2d 44 4f | 53 2e 0a 5c 65 6e 64 7b |or MS-DO|S..\end{|
|00000a70| 64 61 74 61 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |datadesc|}..\begi|
|00000a80| 6e 7b 64 61 74 61 64 65 | 73 63 7d 7b 64 65 66 70 |n{datade|sc}{defp|
|00000a90| 61 74 68 7d 0a 54 68 65 | 20 64 65 66 61 75 6c 74 |ath}.The| default|
|00000aa0| 20 73 65 61 72 63 68 20 | 70 61 74 68 20 75 73 65 | search |path use|
|00000ab0| 64 20 62 79 20 5c 63 6f | 64 65 7b 6f 73 2e 65 78 |d by \co|de{os.ex|
|00000ac0| 65 63 2a 70 2a 28 29 7d | 20 69 66 20 74 68 65 20 |ec*p*()}| if the |
|00000ad0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 0a 64 6f 65 73 |environm|ent.does|
|00000ae0| 6e 27 74 20 68 61 76 65 | 20 61 20 5c 63 6f 64 65 |n't have| a \code|
|00000af0| 7b 27 50 41 54 48 27 7d | 20 6b 65 79 2e 0a 5c 65 |{'PATH'}| key..\e|
|00000b00| 6e 64 7b 64 61 74 61 64 | 65 73 63 7d 0a 0a 5c 62 |nd{datad|esc}..\b|
|00000b10| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 65 |egin{fun|cdesc}{e|
|00000b20| 78 65 63 6c 7d 7b 70 61 | 74 68 5c 2c 20 61 72 67 |xecl}{pa|th\, arg|
|00000b30| 30 5c 2c 20 61 72 67 31 | 5c 2c 20 2e 2e 2e 7d 0a |0\, arg1|\, ...}.|
|00000b40| 54 68 69 73 20 69 73 20 | 65 71 75 69 76 61 6c 65 |This is |equivale|
|00000b50| 6e 74 20 74 6f 0a 5c 63 | 6f 64 65 7b 6f 73 2e 65 |nt to.\c|ode{os.e|
|00000b60| 78 65 63 76 28 5c 76 61 | 72 7b 70 61 74 68 7d 2c |xecv(\va|r{path},|
|00000b70| 20 28 5c 76 61 72 7b 61 | 72 67 30 7d 2c 20 5c 76 | (\var{a|rg0}, \v|
|00000b80| 61 72 7b 61 72 67 31 7d | 2c 20 2e 2e 2e 29 29 7d |ar{arg1}|, ...))}|
|00000b90| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00000ba0| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00000bb0| 63 7d 7b 65 78 65 63 6c | 65 7d 7b 70 61 74 68 5c |c}{execl|e}{path\|
|00000bc0| 2c 20 61 72 67 30 5c 2c | 20 61 72 67 31 5c 2c 20 |, arg0\,| arg1\, |
|00000bd0| 2e 2e 2e 5c 2c 20 65 6e | 76 7d 0a 54 68 69 73 20 |...\, en|v}.This |
|00000be0| 69 73 20 65 71 75 69 76 | 61 6c 65 6e 74 20 74 6f |is equiv|alent to|
|00000bf0| 0a 5c 63 6f 64 65 7b 6f | 73 2e 65 78 65 63 76 65 |.\code{o|s.execve|
|00000c00| 28 5c 76 61 72 7b 70 61 | 74 68 7d 2c 20 28 5c 76 |(\var{pa|th}, (\v|
|00000c10| 61 72 7b 61 72 67 30 7d | 2c 20 5c 76 61 72 7b 61 |ar{arg0}|, \var{a|
|00000c20| 72 67 31 7d 2c 20 2e 2e | 2e 29 2c 20 5c 76 61 72 |rg1}, ..|.), \var|
|00000c30| 7b 65 6e 76 7d 29 7d 2e | 0a 5c 65 6e 64 7b 66 75 |{env})}.|.\end{fu|
|00000c40| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00000c50| 66 75 6e 63 64 65 73 63 | 7d 7b 65 78 65 63 6c 70 |funcdesc|}{execlp|
|00000c60| 7d 7b 70 61 74 68 5c 2c | 20 61 72 67 30 5c 2c 20 |}{path\,| arg0\, |
|00000c70| 61 72 67 31 5c 2c 20 2e | 2e 2e 7d 0a 54 68 69 73 |arg1\, .|..}.This|
|00000c80| 20 69 73 20 65 71 75 69 | 76 61 6c 65 6e 74 20 74 | is equi|valent t|
|00000c90| 6f 0a 5c 63 6f 64 65 7b | 6f 73 2e 65 78 65 63 76 |o.\code{|os.execv|
|00000ca0| 70 28 5c 76 61 72 7b 70 | 61 74 68 7d 2c 20 28 5c |p(\var{p|ath}, (\|
|00000cb0| 76 61 72 7b 61 72 67 30 | 7d 2c 20 5c 76 61 72 7b |var{arg0|}, \var{|
|00000cc0| 61 72 67 31 7d 2c 20 2e | 2e 2e 29 29 7d 2e 0a 5c |arg1}, .|..))}..\|
|00000cd0| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0a 0a 5c |end{func|desc}..\|
|00000ce0| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00000cf0| 65 78 65 63 76 70 7d 7b | 70 61 74 68 5c 2c 20 61 |execvp}{|path\, a|
|00000d00| 72 67 73 7d 0a 54 68 69 | 73 20 69 73 20 6c 69 6b |rgs}.Thi|s is lik|
|00000d10| 65 20 5c 63 6f 64 65 7b | 6f 73 2e 65 78 65 63 76 |e \code{|os.execv|
|00000d20| 28 5c 76 61 72 7b 70 61 | 74 68 7d 2c 20 5c 76 61 |(\var{pa|th}, \va|
|00000d30| 72 7b 61 72 67 73 7d 29 | 7d 20 62 75 74 20 64 75 |r{args})|} but du|
|00000d40| 70 6c 69 63 61 74 65 73 | 0a 74 68 65 20 73 68 65 |plicates|.the she|
|00000d50| 6c 6c 27 73 20 61 63 74 | 69 6f 6e 73 20 69 6e 20 |ll's act|ions in |
|00000d60| 73 65 61 72 63 68 69 6e | 67 20 66 6f 72 20 61 6e |searchin|g for an|
|00000d70| 20 65 78 65 63 75 74 61 | 62 6c 65 20 66 69 6c 65 | executa|ble file|
|00000d80| 20 69 6e 20 61 20 6c 69 | 73 74 20 6f 66 0a 64 69 | in a li|st of.di|
|00000d90| 72 65 63 74 6f 72 69 65 | 73 2e 20 20 54 68 65 20 |rectorie|s. The |
|00000da0| 64 69 72 65 63 74 6f 72 | 79 20 6c 69 73 74 20 69 |director|y list i|
|00000db0| 73 20 6f 62 74 61 69 6e | 65 64 20 66 72 6f 6d 0a |s obtain|ed from.|
|00000dc0| 5c 63 6f 64 65 7b 6f 73 | 2e 65 6e 76 69 72 6f 6e |\code{os|.environ|
|00000dd0| 5b 27 50 41 54 48 27 5d | 7d 2e 0a 5c 65 6e 64 7b |['PATH']|}..\end{|
|00000de0| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00000df0| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 65 78 65 63 |n{funcde|sc}{exec|
|00000e00| 76 70 65 7d 7b 70 61 74 | 68 5c 2c 20 61 72 67 73 |vpe}{pat|h\, args|
|00000e10| 5c 2c 20 65 6e 76 7d 0a | 54 68 69 73 20 69 73 20 |\, env}.|This is |
|00000e20| 61 20 63 72 6f 73 73 20 | 62 65 74 77 65 65 6e 20 |a cross |between |
|00000e30| 5c 63 6f 64 65 7b 6f 73 | 2e 65 78 65 63 76 65 28 |\code{os|.execve(|
|00000e40| 29 7d 20 61 6e 64 20 5c | 63 6f 64 65 7b 6f 73 2e |)} and \|code{os.|
|00000e50| 65 78 65 63 76 70 28 29 | 7d 2e 0a 54 68 65 20 64 |execvp()|}..The d|
|00000e60| 69 72 65 63 74 6f 72 79 | 20 6c 69 73 74 20 69 73 |irectory| list is|
|00000e70| 20 6f 62 74 61 69 6e 65 | 64 20 66 72 6f 6d 20 5c | obtaine|d from \|
|00000e80| 63 6f 64 65 7b 5c 76 61 | 72 7b 65 6e 76 7d 5b 27 |code{\va|r{env}['|
|00000e90| 50 41 54 48 27 5d 7d 2e | 0a 5c 65 6e 64 7b 66 75 |PATH']}.|.\end{fu|
|00000ea0| 6e 63 64 65 73 63 7d 0a | 0a 28 54 68 65 20 66 75 |ncdesc}.|.(The fu|
|00000eb0| 6e 63 74 69 6f 6e 73 20 | 5c 63 6f 64 65 7b 6f 73 |nctions |\code{os|
|00000ec0| 2e 65 78 65 63 76 28 29 | 7d 20 61 6e 64 20 5c 63 |.execv()|} and \c|
|00000ed0| 6f 64 65 7b 65 78 65 63 | 76 65 28 29 7d 20 61 72 |ode{exec|ve()} ar|
|00000ee0| 65 20 6e 6f 74 0a 64 6f | 63 75 6d 65 6e 74 65 64 |e not.do|cumented|
|00000ef0| 20 68 65 72 65 2c 20 73 | 69 6e 63 65 20 74 68 65 | here, s|ince the|
|00000f00| 79 20 61 72 65 20 69 6d | 70 6c 65 6d 65 6e 74 65 |y are im|plemente|
|00000f10| 64 20 62 79 20 74 68 65 | 20 4f 53 20 64 65 70 65 |d by the| OS depe|
|00000f20| 6e 64 65 6e 74 0a 6d 6f | 64 75 6c 65 2e 20 20 49 |ndent.mo|dule. I|
|00000f30| 66 20 74 68 65 20 4f 53 | 20 64 65 70 65 6e 64 65 |f the OS| depende|
|00000f40| 6e 74 20 6d 6f 64 75 6c | 65 20 64 6f 65 73 6e 27 |nt modul|e doesn'|
|00000f50| 74 20 64 65 66 69 6e 65 | 20 65 69 74 68 65 72 20 |t define| either |
|00000f60| 6f 66 20 74 68 65 73 65 | 2c 0a 74 68 65 20 66 75 |of these|,.the fu|
|00000f70| 6e 63 74 69 6f 6e 73 20 | 74 68 61 74 20 72 65 6c |nctions |that rel|
|00000f80| 79 20 6f 6e 20 69 74 20 | 77 69 6c 6c 20 72 61 69 |y on it |will rai|
|00000f90| 73 65 20 61 6e 20 65 78 | 63 65 70 74 69 6f 6e 2e |se an ex|ception.|
|00000fa0| 20 20 54 68 65 79 20 61 | 72 65 0a 64 6f 63 75 6d | They a|re.docum|
|00000fb0| 65 6e 74 65 64 20 69 6e | 20 74 68 65 20 73 65 63 |ented in| the sec|
|00000fc0| 74 69 6f 6e 20 6f 6e 20 | 6d 6f 64 75 6c 65 20 5c |tion on |module \|
|00000fd0| 63 6f 64 65 7b 70 6f 73 | 69 78 7d 2c 20 74 6f 67 |code{pos|ix}, tog|
|00000fe0| 65 74 68 65 72 20 77 69 | 74 68 20 61 6c 6c 0a 6f |ether wi|th all.o|
|00000ff0| 74 68 65 72 20 66 75 6e | 63 74 69 6f 6e 73 20 74 |ther fun|ctions t|
|00001000| 68 61 74 20 5c 63 6f 64 | 65 7b 6f 73 7d 20 69 6d |hat \cod|e{os} im|
|00001010| 70 6f 72 74 73 20 66 72 | 6f 6d 20 74 68 65 20 4f |ports fr|om the O|
|00001020| 53 20 64 65 70 65 6e 64 | 65 6e 74 20 6d 6f 64 75 |S depend|ent modu|
|00001030| 6c 65 2e 29 0a | |le.). | |
+--------+-------------------------+-------------------------+--------+--------+