DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: m

⟦355060a21⟧

    Length: 2493 (0x9bd)
    Names: »mkdirp.3«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./usr/man/cat3/mkdirp.3« 

Default Hex Dump

0x000…020 0a 0a 0a 5f 08 4f 5f 08 6e 5f 08 6c 5f 08 69 5f 08 6e 5f 08 65 20 5f 08 4d 5f 08 61 5f 08 6e 5f   ┆   _ O_ n_ l_ i_ n_ e _ M_ a_ n_┆
0x020…040 08 75 5f 08 61 5f 08 6c 20 20 20 20 20 20 20 20 20 20 20 4c 69 62 72 61 72 79 20 46 75 6e 63 74   ┆ u_ a_ l           Library Funct┆
0x040…060 69 6f 6e 73 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 6b 64 69 72 70 28 33 29 0a 0a 0a 0a   ┆ions               mkdirp(3)    ┆
0x060…080 4e 08 4e 08 4e 08 4e 41 08 41 08 41 08 41 4d 08 4d 08 4d 08 4d 45 08 45 08 45 08 45 0a 20 20 20   ┆N N N NA A A AM M M ME E E E    ┆
0x080…0a0 20 20 6d 6b 64 69 72 70 2c 20 72 6d 64 69 72 70 20 2d 20 63 72 65 61 74 65 2c 20 72 65 6d 6f 76   ┆  mkdirp, rmdirp - create, remov┆
0x0a0…0c0 65 20 64 69 72 65 63 74 6f 72 69 65 73 20 69 6e 20 61 20 70 61 74 68 0a 0a 53 08 53 08 53 08 53   ┆e directories in a path  S S S S┆
0x0c0…0e0 59 08 59 08 59 08 59 4e 08 4e 08 4e 08 4e 54 08 54 08 54 08 54 41 08 41 08 41 08 41 58 08 58 08   ┆Y Y Y YN N N NT T T TA A A AX X ┆
0x0e0…100 58 08 58 0a 20 20 20 20 20 69 08 69 08 69 08 69 6e 08 6e 08 6e 08 6e 74 08 74 08 74 08 74 20 6d   ┆X X      i i i in n n nt t t t m┆
0x100…120 08 6d 08 6d 08 6d 6b 08 6b 08 6b 08 6b 64 08 64 08 64 08 64 69 08 69 08 69 08 69 72 08 72 08 72   ┆ m m mk k k kd d d di i i ir r r┆
0x120…140 08 72 70 08 70 08 70 08 70 20 28 08 28 08 28 08 28 63 08 63 08 63 08 63 6f 08 6f 08 6f 08 6f 6e   ┆ rp p p p ( ( ( (c c c co o o on┆
0x140…160 08 6e 08 6e 08 6e 73 08 73 08 73 08 73 74 08 74 08 74 08 74 20 63 08 63 08 63 08 63 68 08 68 08   ┆ n n ns s s st t t t c c c ch h ┆
0x160…180 68 08 68 61 08 61 08 61 08 61 72 08 72 08 72 08 72 20 2a 08 2a 08 2a 08 2a 70 08 70 08 70 08 70   ┆h ha a a ar r r r * * * *p p p p┆
0x180…1a0 61 08 61 08 61 08 61 74 08 74 08 74 08 74 68 08 68 08 68 08 68 2c 08 2c 08 2c 08 2c 20 6d 08 6d   ┆a a a at t t th h h h, , , , m m┆
0x1a0…1c0 08 6d 08 6d 6f 08 6f 08 6f 08 6f 64 08 64 08 64 08 64 65 08 65 08 65 08 65 5f 08 5f 08 5f 08 5f   ┆ m mo o o od d d de e e e_ _ _ _┆
0x1c0…1e0 74 08 74 08 74 08 74 20 6d 08 6d 08 6d 08 6d 6f 08 6f 08 6f 08 6f 64 08 64 08 64 08 64 65 08 65   ┆t t t t m m m mo o o od d d de e┆
0x1e0…200 08 65 08 65 29 08 29 08 29 08 29 3b 08 3b 08 3b 08 3b 0a 0a 20 20 20 20 20 69 08 69 08 69 08 69   ┆ e e) ) ) ); ; ; ;       i i i i┆
0x200…220 6e 08 6e 08 6e 08 6e 74 08 74 08 74 08 74 20 72 08 72 08 72 08 72 6d 08 6d 08 6d 08 6d 64 08 64   ┆n n n nt t t t r r r rm m m md d┆
0x220…240 08 64 08 64 69 08 69 08 69 08 69 72 08 72 08 72 08 72 70 08 70 08 70 08 70 20 28 08 28 08 28 08   ┆ d di i i ir r r rp p p p ( ( ( ┆
0x240…260 28 63 08 63 08 63 08 63 68 08 68 08 68 08 68 61 08 61 08 61 08 61 72 08 72 08 72 08 72 20 2a 08   ┆(c c c ch h h ha a a ar r r r * ┆
0x260…280 2a 08 2a 08 2a 64 08 64 08 64 08 64 2c 08 2c 08 2c 08 2c 20 63 08 63 08 63 08 63 68 08 68 08 68   ┆* * *d d d d, , , , c c c ch h h┆
0x280…2a0 08 68 61 08 61 08 61 08 61 72 08 72 08 72 08 72 20 2a 08 2a 08 2a 08 2a 64 08 64 08 64 08 64 31   ┆ ha a a ar r r r * * * *d d d d1┆
0x2a0…2c0 08 31 08 31 08 31 29 08 29 08 29 08 29 3b 08 3b 08 3b 08 3b 0a 0a 44 08 44 08 44 08 44 45 08 45   ┆ 1 1 1) ) ) ); ; ; ;  D D D DE E┆
0x2c0…2e0 08 45 08 45 53 08 53 08 53 08 53 43 08 43 08 43 08 43 52 08 52 08 52 08 52 49 08 49 08 49 08 49   ┆ E ES S S SC C C CR R R RI I I I┆
0x2e0…300 50 08 50 08 50 08 50 54 08 54 08 54 08 54 49 08 49 08 49 08 49 4f 08 4f 08 4f 08 4f 4e 08 4e 08   ┆P P P PT T T TI I I IO O O ON N ┆
0x300…320 4e 08 4e 0a 20 20 20 20 20 5f 08 6d 5f 08 6b 5f 08 64 5f 08 69 5f 08 72 5f 08 70 20 63 72 65 61   ┆N N      _ m_ k_ d_ i_ r_ p crea┆
0x320…340 74 65 73 20 61 6c 6c 20 74 68 65 20 6d 69 73 73 69 6e 67 20 64 69 72 65 63 74 6f 72 69 65 73 20   ┆tes all the missing directories ┆
0x340…360 69 6e 20 74 68 65 20 67 69 76 65 6e 20 5f 08 70 5f 08 61 5f 08 74 5f 08 68 0a 20 20 20 20 20 77   ┆in the given _ p_ a_ t_ h      w┆
0x360…380 69 74 68 20 74 68 65 20 67 69 76 65 6e 20 5f 08 6d 5f 08 6f 5f 08 64 5f 08 65 2e 20 20 5b 53 65   ┆ith the given _ m_ o_ d_ e.  [Se┆
0x380…3a0 65 20 5f 08 63 5f 08 68 5f 08 6d 5f 08 6f 5f 08 64 28 32 29 20 66 6f 72 20 74 68 65 20 76 61 6c   ┆e _ c_ h_ m_ o_ d(2) for the val┆
0x3a0…3c0 75 65 73 20 6f 66 20 5f 08 6d 5f 08 6f 5f 08 64 5f 08 65 2e 5d 0a 0a 20 20 20 20 20 5f 08 72 5f   ┆ues of _ m_ o_ d_ e.]       _ r_┆
0x3c0…3e0 08 6d 5f 08 64 5f 08 69 5f 08 72 5f 08 70 20 72 65 6d 6f 76 65 73 20 64 69 72 65 63 74 6f 72 69   ┆ m_ d_ i_ r_ p removes directori┆
0x3e0…400 65 73 20 69 6e 20 70 61 74 68 20 5f 08 64 2e 20 54 68 69 73 20 72 65 6d 6f 76 61 6c 20 73 74 61   ┆es in path _ d. This removal sta┆
0x400…420 72 74 73 20 61 74 0a 20 20 20 20 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 70 61 74 68 20   ┆rts at      the end of the path ┆
0x420…440 61 6e 64 20 6d 6f 76 65 73 20 62 61 63 6b 20 74 6f 77 61 72 64 20 74 68 65 20 72 6f 6f 74 20 61   ┆and moves back toward the root a┆
0x440…460 73 20 66 61 72 20 61 73 0a 20 20 20 20 20 70 6f 73 73 69 62 6c 65 2e 20 20 49 66 20 61 6e 20 65   ┆s far as      possible.  If an e┆
0x460…480 72 72 6f 72 20 6f 63 63 75 72 73 2c 20 74 68 65 20 72 65 6d 61 69 6e 69 6e 67 20 70 61 74 68 20   ┆rror occurs, the remaining path ┆
0x480…4a0 69 73 20 73 74 6f 72 65 64 0a 20 20 20 20 20 69 6e 20 5f 08 64 5f 08 31 2e 20 20 5f 08 72 5f 08   ┆is stored      in _ d_ 1.  _ r_ ┆
0x4a0…4c0 6d 5f 08 64 5f 08 69 5f 08 72 5f 08 70 20 72 65 74 75 72 6e 73 20 61 20 30 20 6f 6e 6c 79 20 69   ┆m_ d_ i_ r_ p returns a 0 only i┆
0x4c0…4e0 66 20 69 74 20 69 73 20 61 62 6c 65 20 74 6f 20 72 65 6d 6f 76 65 0a 20 20 20 20 20 65 76 65 72   ┆f it is able to remove      ever┆
0x4e0…500 79 20 64 69 72 65 63 74 6f 72 79 20 69 6e 20 74 68 65 20 70 61 74 68 2e 0a 0a 45 08 45 08 45 08   ┆y directory in the path.  E E E ┆
0x500…520 45 58 08 58 08 58 08 58 41 08 41 08 41 08 41 4d 08 4d 08 4d 08 4d 50 08 50 08 50 08 50 4c 08 4c   ┆EX X X XA A A AM M M MP P P PL L┆
0x520…540 08 4c 08 4c 45 08 45 08 45 08 45 53 08 53 08 53 08 53 0a 20 20 20 20 20 2f 2a 20 63 72 65 61 74   ┆ L LE E E ES S S S      /* creat┆
0x540…560 65 20 73 63 72 61 74 63 68 20 64 69 72 65 63 74 6f 72 69 65 73 20 2a 2f 0a 20 20 20 20 20 69 66   ┆e scratch directories */      if┆
0x560…580 28 6d 6b 64 69 72 70 28 22 2f 74 6d 70 2f 73 75 62 31 2f 73 75 62 32 2f 73 75 62 33 22 2c 20 30   ┆(mkdirp("/tmp/sub1/sub2/sub3", 0┆
0x580…5a0 37 35 35 29 20 3d 3d 20 2d 31 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 66 70 72 69 6e 74 66 28   ┆755) == -1) {           fprintf(┆
0x5a0…5c0 73 74 64 65 72 72 2c 20 22 63 61 6e 6e 6f 74 20 63 72 65 61 74 65 20 64 69 72 65 63 74 6f 72 79   ┆stderr, "cannot create directory┆
0x5c0…5e0 22 29 3b 0a 20 20 20 20 20 20 20 20 20 20 65 78 69 74 28 31 29 3b 0a 20 20 20 20 20 7d 0a 20 20   ┆");           exit(1);      }   ┆
0x5e0…600 20 20 20 63 68 64 69 72 28 22 2f 74 6d 70 2f 73 75 62 31 2f 73 75 62 32 2f 73 75 62 33 22 29 3b   ┆   chdir("/tmp/sub1/sub2/sub3");┆
0x600…620 0a 20 20 20 20 20 2e 0a 20 20 20 20 20 2e 0a 20 20 20 20 20 2e 0a 20 20 20 20 20 2f 2a 20 63 6c   ┆      .      .      .      /* cl┆
0x620…640 65 61 6e 75 70 20 2a 2f 0a 20 20 20 20 20 63 68 64 69 72 28 22 2f 74 6d 70 22 29 3b 0a 20 20 20   ┆eanup */      chdir("/tmp");    ┆
0x640…660 20 20 72 6d 64 69 72 70 28 22 73 75 62 31 2f 73 75 62 32 2f 73 75 62 33 22 29 3b 0a 0a 53 08 53   ┆  rmdirp("sub1/sub2/sub3");  S S┆
0x660…680 08 53 08 53 45 08 45 08 45 08 45 45 08 45 08 45 08 45 20 41 08 41 08 41 08 41 4c 08 4c 08 4c 08   ┆ S SE E E EE E E E A A A AL L L ┆
0x680…6a0 4c 53 08 53 08 53 08 53 4f 08 4f 08 4f 08 4f 0a 20 20 20 20 20 53 79 73 74 65 6d 20 43 61 6c 6c   ┆LS S S SO O O O      System Call┆
0x6a0…6c0 73 20 28 32 29 3a 20 6d 6b 64 69 72 2c 20 72 6d 64 69 72 0a 0a 44 08 44 08 44 08 44 49 08 49 08   ┆s (2): mkdir, rmdir  D D D DI I ┆
0x6c0…6e0 49 08 49 41 08 41 08 41 08 41 47 08 47 08 47 08 47 4e 08 4e 08 4e 08 4e 4f 08 4f 08 4f 08 4f 53   ┆I IA A A AG G G GN N N NO O O OS┆
0x6e0…700 08 53 08 53 08 53 54 08 54 08 54 08 54 49 08 49 08 49 08 49 43 08 43 08 43 08 43 53 08 53 08 53   ┆ S S ST T T TI I I IC C C CS S S┆
0x700…720 08 53 0a 20 20 20 20 20 49 66 20 61 20 6e 65 65 64 65 64 20 64 69 72 65 63 74 6f 72 79 20 63 61   ┆ S      If a needed directory ca┆
0x720…740 6e 6e 6f 74 20 62 65 20 63 72 65 61 74 65 64 2c 20 5f 08 6d 5f 08 6b 5f 08 64 5f 08 69 5f 08 72   ┆nnot be created, _ m_ k_ d_ i_ r┆
0x740…760 5f 08 70 20 72 65 74 75 72 6e 73 20 2d 31 0a 20 20 20 20 20 61 6e 64 20 73 65 74 73 20 65 08 65   ┆_ p returns -1      and sets e e┆
0x760…780 08 65 08 65 72 08 72 08 72 08 72 72 08 72 08 72 08 72 6e 08 6e 08 6e 08 6e 6f 08 6f 08 6f 08 6f   ┆ e er r r rr r r rn n n no o o o┆
0x780…7a0 20 74 6f 20 6f 6e 65 20 6f 66 20 74 68 65 20 5f 08 6d 5f 08 6b 5f 08 64 5f 08 69 5f 08 72 20 65   ┆ to one of the _ m_ k_ d_ i_ r e┆
0x7a0…7c0 72 72 6f 72 20 6e 75 6d 62 65 72 73 2e 20 20 49 66 20 61 6c 6c 0a 20 20 20 20 20 74 68 65 20 64   ┆rror numbers.  If all      the d┆
0x7c0…7e0 69 72 65 63 74 6f 72 69 65 73 20 61 72 65 20 63 72 65 61 74 65 64 2c 20 6f 72 20 65 78 69 73 74   ┆irectories are created, or exist┆
0x7e0…800 65 64 20 74 6f 20 62 65 67 69 6e 20 77 69 74 68 2c 20 69 74 0a 20 20 20 20 20 72 65 74 75 72 6e   ┆ed to begin with, it      return┆
0x800…820 73 20 7a 65 72 6f 2e 0a 0a 4e 08 4e 08 4e 08 4e 4f 08 4f 08 4f 08 4f 54 08 54 08 54 08 54 45 08   ┆s zero.  N N N NO O O OT T T TE ┆
0x820…840 45 08 45 08 45 53 08 53 08 53 08 53 0a 20 20 20 20 20 5f 08 6d 5f 08 6b 5f 08 64 5f 08 69 5f 08   ┆E E ES S S S      _ m_ k_ d_ i_ ┆
0x840…860 72 5f 08 70 20 75 73 65 73 20 5f 08 6d 5f 08 61 5f 08 6c 5f 08 6c 5f 08 6f 5f 08 63 20 74 6f 20   ┆r_ p uses _ m_ a_ l_ l_ o_ c to ┆
0x860…880 61 6c 6c 6f 63 61 74 65 20 74 65 6d 70 6f 72 61 72 79 20 73 70 61 63 65 20 66 6f 72 20 74 68 65   ┆allocate temporary space for the┆
0x880…8a0 0a 20 20 20 20 20 73 74 72 69 6e 67 2e 0a 0a 20 20 20 20 20 5f 08 72 5f 08 6d 5f 08 64 5f 08 69   ┆      string.       _ r_ m_ d_ i┆
0x8a0…8c0 5f 08 72 5f 08 70 20 72 65 74 75 72 6e 73 20 2d 32 20 69 66 20 61 20 60 60 2e 08 2e 08 2e 08 2e   ┆_ r_ p returns -2 if a ``. . . .┆
0x8c0…8e0 27 27 20 6f 72 20 60 60 2e 08 2e 08 2e 08 2e 2e 08 2e 08 2e 08 2e 27 27 20 69 73 20 69 6e 20 74   ┆'' or ``. . . .. . . .'' is in t┆
0x8e0…900 68 65 20 70 61 74 68 20 61 6e 64 20 2d 33 0a 20 20 20 20 20 69 66 20 61 6e 20 61 74 74 65 6d 70   ┆he path and -3      if an attemp┆
0x900…920 74 20 69 73 20 6d 61 64 65 20 74 6f 20 72 65 6d 6f 76 65 20 74 68 65 20 63 75 72 72 65 6e 74 20   ┆t is made to remove the current ┆
0x920…940 64 69 72 65 63 74 6f 72 79 2e 20 20 49 66 0a 20 20 20 20 20 61 6e 20 65 72 72 6f 72 20 6f 63 63   ┆directory.  If      an error occ┆
0x940…960 75 72 73 20 6f 74 68 65 72 20 74 68 61 6e 20 6f 6e 65 20 6f 66 20 74 68 65 20 61 62 6f 76 65 2c   ┆urs other than one of the above,┆
0x960…980 20 2d 31 20 69 73 20 72 65 74 75 72 6e 65 64 2e 0a 0a 41 75 67 75 73 74 20 31 39 39 31 20 20 20   ┆ -1 is returned.  August 1991   ┆
0x980…9a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 58 20 50 72 6f   ┆                          TX Pro┆
0x9a0…9bd 67 72 61 6d 6d 65 72 27 73 20 52 65 66 65 72 65 6e 63 65 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a            ┆grammer's Reference          ┆