Knowledge

Working directory

Source 📝

355:
Under DOS, the absolute paths of the working directories of all logical volumes are internally stored in an array-like data structure called the Current Directory Structure (CDS), which gets dynamically allocated at boot time to hold the necessary number of slots for all logical drives (or as defined
279:(for "Batch"). This modifies the output of commands to become suitable for direct command line input (when redirecting it into a batch file) or usage as a parameter for other commands (using it as input for another command). Where 846:(NB. NWDOSTIP.TXT is a comprehensive work on Novell DOS 7 and OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger 360:). This structure imposes a length-limit of 66 characters on the full path of each working directory, and thus implicitly also limits the maximum possible depth of subdirectories. 634: 809: 445:
with a path to the new directory, either absolute or relative to the old one. Where available, it can be called by a process to set its working directory.
807: 257:
command omitting the terminating linefeed. This can be used to create a temporary batchjob storing the working directory in an environment variable like
778:
Undocumented DOS: A programmer's guide to reserved MS-DOS functions and data structures - expanded to include MS-DOS 6, Novell DOS and Windows 3.1
933: 697: 1042: 1011: 850:
collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the
900: 834: 970: 17: 736: 73:), the reference is interpreted relative to the working directory of the process. So for example a process with working directory 801: 855: 830:
NWDOS-TIPs — Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds
312:
command To keep the prompt short even inside of deep subdirectory structures, the DR-DOS 7.07 COMMAND.COM supports a
791: 413: 1083: 357: 193: 626: 420:
functions of the operating system, including the ability to set (change) the working directory of the program.
167: 460: 189: 158:
command outputs a full pathname of the working directory; the equivalent command in DOS and Windows is
687: 1030: 999: 921: 722: 396:(with BDOS 7.0) and DR DOS 6.0 (1992 update with BDOS 7.1) and higher switched to use a CDS for 1026: 995: 896:
NWDOS7UN.TXT — Zusammenfassung der dokumentierten und undokumentierten Fähigkeiten von Novell DOS 7
532: 47: 43: 612: 894: 828: 118: 98: 954: 540: 490: 746: 409: 308: 182: 8: 145: 39: 962: 776: 253: 130: 400:
with DOS programs as well, they faced the same limitations as present in other DOSes.
1067: 797: 787: 536: 397: 234: 122: 966: 528: 442: 66: 264:
ECHOS SET CD=> SETCD.BAT CHDIR >> SETCD.BAT CALL SETCD.BAT DEL SETCD.BAT
1066: – a software package that tracks commonly used directories in a 299:
would create a temporary batchjob allowing to return to this directory later on.
141: 929: 783: 587: 485: 480: 377: 175: 70: 1063: 233:
etc.) can be used in scripts, so that one need not start an external program.
50:, if any, dynamically associated with the process. It is sometimes called the 1077: 866: 771: 742: 693: 590:
messages or delays when trying to retrieve the path of a non-inserted floppy.
507: 268: 237: 103:
In most computer file systems, every directory has an entry (usually named "
955:"JDK-4045688: Add chdir or equivalent notion of changing working directory" 449: 135: 94: 870: 670:; Paul, Matthias R.; Dye, Charles E.; Georgiev, Luchezar I. (2002-02-27). 316:
token to display only the deepest subdirectory level. So, where a default
667: 571: 438: 417: 272: 244: 230: 198: 372:
6.7 in 1991) had no such limitation due to their implementation using a
689:
DR-DOS 7.03 WHATSNEW.TXT — Changes from DR-DOS 7.02 to DR-DOS 7.03
663: 501: 424: 365: 275:
and higher, various internal and external commands support a parameter
149: 65:. When a process refers to a file using a simple file name or relative 1038: 1007: 671: 630: 31: 893:
Paul, Matthias R. (1997-06-07) . "Chapter 1.3.xi: Überlange Pfade".
583: 361: 874: 393: 381: 202: 126: 922:"The Open Group Base Specifications Issue 6 and IEEE Std 1003.1" 765: 763: 448:
There are similar functions in other languages. For example, in
568: 544: 495: 384:-)derived kernel, which internally organized subdirectories as 373: 760: 428: 925: 369: 349: 226: 222: 115: 769: 154: 111: 55: 774:; Maxey, David; Michels, Raymond J.; Kyle, Jim (1994) . 535:
but have no concept of "working directory"; for example
441:
which changes the working directory. Its argument is a
69:(as opposed to a file designated by a full path from a 661: 1000:"Why does each drive have its own current directory?" 888: 886: 884: 822: 820: 818: 816: 463:, the working directory can be obtained through the 174:
used without arguments takes the user back to their
133:, the working directory can be changed by using the 1031:"What are these strange =C: environment variables?" 881: 813: 775: 680: 627:"Microsoft Windows – SetCurrentDirectory function" 619: 240:have the ability to store the working directory. 1075: 729: 719:CCI Multiuser DOS 7.22 GOLD Online Documentation 657: 655: 653: 651: 471:class. The working directory cannot be changed. 859: 302:The working directory is also displayed by the 806:(xviii+856+vi pages, 3.5-inch floppy) Errata: 648: 711: 555: 553: 403: 388:links to parent directories instead of as 340:, respectively. A similar facility (using 107:") which points to the directory itself. 550: 364:and older issues of DR DOS (up to 88: 14: 1076: 782:(2 ed.). Reading, Massachusetts: 582:except for that it gets suppressed on 521: 865: 833:. MPDOSTIP (in German) (3 ed.). 604: 27:Computer file system currently in use 1025: 994: 914: 892: 826: 947: 24: 988: 869:; et al., eds. (2000-07-16). 504:(a different, but related concept) 283:would issue a directory path like 25: 1095: 1057: 827:Paul, Matthias R. (1997-07-30) . 1064:Working Directory (wd) at Github 1045:from the original on 2018-05-27 1014:from the original on 2016-04-12 973:from the original on 2017-10-19 936:from the original on 2018-02-09 903:from the original on 2016-11-07 837:from the original on 2017-09-10 700:from the original on 2019-04-08 637:from the original on 2018-05-27 205:, but not in OS/2 and DOS), or 188:(in Unix/Linux shells), or the 52:current working directory (CWD) 924:(Issue 6, 2004 ed.). The 738:Caldera DR-DOS 7.02 User Guide 81:will end up creating the file 13: 1: 871:"Ralf Brown's Interrupt List" 597: 77:that asks to create the file 725:(CCI). 1997-02-10. HELP.HLP. 261:for later use, for example: 190:pseudo-environment variables 7: 474: 18:Current Directory Structure 10: 1100: 467:interface, or through the 125:command line interpreters 92: 723:Concurrent Controls, Inc. 899:. MPDOSTIP (in German). 563:works as alternative to 533:hierarchical file system 514: 404:In programming languages 297:CHDIR /B > RETDIR.BAT 48:hierarchical file system 1084:File system directories 452:it is usually spelled 99:operating system shell 745:1998 . Archived from 673:4DOS 8.00 online help 410:programming languages 398:maximum compatibility 320:would result f.e. in 267:Alternatively, under 93:Further information: 83:/rabbit-shoes/foo.txt 332:would instead yield 247:and higher provides 183:environment variable 121:, as well as in the 89:In operating systems 559:In the same way as 251:, a variant of the 770:Schulman, Andrew; 662:Brothers, Hardin; 586:in order to avoid 465:java.nio.file.Path 170:(whereas in Unix, 131:Windows PowerShell 61:function, or just 1035:The New Old Thing 1004:The New Old Thing 802:978-0-201-63287-3 537:Texas Instruments 529:operating systems 330:PROMPT $ N:$ W$ G 295:instead, so that 287:, a command like 235:Microsoft Windows 123:Microsoft Windows 63:current directory 36:working directory 16:(Redirected from 1091: 1053: 1051: 1050: 1022: 1020: 1019: 982: 981: 979: 978: 969:). 2008-08-18 . 967:Sun Microsystems 951: 945: 944: 942: 941: 918: 912: 911: 909: 908: 890: 879: 878: 863: 857: 853: 849: 845: 843: 842: 824: 811: 805: 781: 767: 758: 757: 755: 754: 733: 727: 726: 715: 709: 708: 706: 705: 684: 678: 677: 659: 646: 645: 643: 642: 623: 617: 616: 615: 608: 591: 557: 548: 525: 470: 466: 455: 435: 339: 335: 327: 326:C:\DOS\DRDOS> 323: 311: 294: 286: 21: 1099: 1098: 1094: 1093: 1092: 1090: 1089: 1088: 1074: 1073: 1060: 1048: 1046: 1017: 1015: 991: 989:Further reading 986: 985: 976: 974: 953: 952: 948: 939: 937: 920: 919: 915: 906: 904: 891: 882: 873:(61 ed.). 864: 860: 851: 847: 840: 838: 825: 814: 794: 768: 761: 752: 750: 735: 734: 730: 717: 716: 712: 703: 701: 686: 685: 681: 660: 649: 640: 638: 625: 624: 620: 611: 610: 609: 605: 600: 595: 594: 581: 577: 566: 562: 558: 551: 543:, used for the 531:that support a 526: 522: 517: 498:(Linux systems) 477: 468: 464: 453: 433: 406: 366:DR DOS 6.0 348:) was added to 347: 343: 337: 333: 331: 325: 321: 319: 315: 307: 305: 298: 292: 290: 284: 282: 278: 265: 260: 256: 250: 243:COMMAND.COM in 220: 216: 212: 208: 196: 187: 173: 165: 161: 157: 144: 138: 106: 101: 91: 84: 80: 76: 60: 28: 23: 22: 15: 12: 11: 5: 1097: 1087: 1086: 1072: 1071: 1059: 1058:External links 1056: 1055: 1054: 1029:(2010-05-06). 1023: 998:(2010-10-11). 990: 987: 984: 983: 946: 930:The Open Group 913: 880: 867:Brown, Ralf D. 858: 812: 792: 784:Addison Wesley 772:Brown, Ralf D. 759: 728: 710: 679: 647: 618: 602: 601: 599: 596: 593: 592: 588:critical error 579: 575: 564: 560: 549: 519: 518: 516: 513: 512: 511: 505: 499: 493: 488: 486:Root directory 483: 481:Home directory 476: 473: 405: 402: 378:Concurrent DOS 345: 341: 329: 317: 313: 303: 296: 288: 280: 276: 263: 258: 252: 248: 238:file shortcuts 218: 214: 210: 206: 192: 185: 176:home directory 171: 163: 159: 153: 140: 134: 119:command shells 104: 90: 87: 82: 78: 74: 71:root directory 58: 26: 9: 6: 4: 3: 2: 1096: 1085: 1082: 1081: 1079: 1069: 1065: 1062: 1061: 1044: 1040: 1036: 1032: 1028: 1027:Chen, Raymond 1024: 1013: 1009: 1005: 1001: 997: 996:Chen, Raymond 993: 992: 972: 968: 964: 960: 956: 950: 935: 931: 927: 923: 917: 902: 898: 897: 889: 887: 885: 876: 872: 868: 862: 856: 836: 832: 831: 823: 821: 819: 817: 810: 808: 803: 799: 795: 793:0-201-63287-X 789: 785: 780: 779: 773: 766: 764: 749:on 2016-11-04 748: 744: 743:Caldera, Inc. 740: 739: 732: 724: 720: 714: 699: 695: 694:Caldera, Inc. 691: 690: 683: 675: 674: 669: 665: 658: 656: 654: 652: 636: 632: 628: 622: 614: 607: 603: 589: 585: 578:has an alias 573: 570: 556: 554: 546: 542: 538: 534: 530: 524: 520: 509: 508:Long filename 506: 503: 500: 497: 494: 492: 489: 487: 484: 482: 479: 478: 472: 462: 457: 451: 446: 444: 440: 436: 430: 426: 421: 419: 415: 411: 401: 399: 395: 392:paths. Since 391: 387: 383: 379: 375: 374:DOS emulation 371: 367: 363: 359: 353: 351: 318:PROMPT $ P$ G 310: 306:token of the 300: 274: 270: 269:Multiuser DOS 262: 255: 246: 241: 239: 236: 232: 228: 224: 204: 200: 195: 191: 184: 179: 177: 169: 156: 151: 147: 143: 137: 132: 128: 124: 120: 117: 113: 108: 100: 96: 86: 75:/rabbit-shoes 72: 68: 64: 57: 53: 49: 45: 41: 37: 33: 19: 1047:. Retrieved 1034: 1016:. Retrieved 1003: 975:. Retrieved 959:Bug Database 958: 949: 938:. Retrieved 916: 905:. Retrieved 895: 861: 852:NWDOSTIP.TXT 848:MPDOSTIP.ZIP 839:. Retrieved 829: 777: 751:. Retrieved 747:the original 737: 731: 718: 713: 702:. Retrieved 696:1998-12-24. 688: 682: 672: 668:Conn, Rex C. 639:. Retrieved 621: 606: 523: 469:java.io.File 458: 450:Visual Basic 447: 437:effects the 432: 422: 407: 389: 385: 380:- (and thus 376:on top of a 354: 301: 293:CHDIR C:\DOS 291:would issue 266: 242: 197:(in Windows 180: 109: 102: 95:cd (command) 62: 51: 35: 29: 664:Rawson, Tom 572:COMMAND.COM 443:text string 439:system call 418:file system 412:provide an 338:C:DRDOS> 273:DR-DOS 7.02 245:DR-DOS 7.02 199:COMMAND.COM 150:Unix shells 54:, e.g. the 1049:2017-05-27 1018:2017-05-27 977:2011-02-20 940:2018-05-27 907:2016-11-07 841:2014-08-06 753:2013-08-10 704:2019-04-08 641:2017-05-27 598:References 527:There are 502:Load drive 425:C language 322:C:\DOS> 1039:Microsoft 1008:Microsoft 932:. 2004 . 631:Microsoft 613:getcwd(3) 491:Directory 431:function 414:interface 358:LASTDRIVE 352:as well. 334:C:DOS> 168:arguments 44:directory 32:computing 1078:Category 1043:Archived 1012:Archived 971:Archived 934:Archived 901:Archived 835:Archived 698:Archived 635:Archived 584:floppies 475:See also 390:absolute 386:relative 362:DOS Plus 289:CHDIR /B 166:without 146:commands 110:In most 1070:session 875:INTER61 854:file.) 547:series. 454:CHDIR() 434:chdir() 423:In the 416:to the 394:PalmDOS 382:CP/M-86 368:, with 221:(under 203:cmd.exe 127:cmd.exe 79:foo.txt 40:process 963:Oracle 800:  790:  569:DR-DOS 567:under 545:TI-990 496:chroot 427:, the 309:PROMPT 285:C:\DOS 152:, the 59:getcwd 34:, the 515:Notes 510:(LFN) 429:POSIX 408:Most 281:CHDIR 249:ECHOS 219:_CWPS 211:_CWDS 164:CHDIR 148:. In 142:CHDIR 46:of a 42:is a 38:of a 1068:bash 928:and 926:IEEE 798:ISBN 788:ISBN 541:DX10 461:Java 370:BDOS 350:4DOS 344:and 336:and 328:, a 271:and 254:ECHO 227:4OS2 223:4DOS 217:and 215:_CWP 207:_CWD 201:and 181:The 129:and 116:UNIX 114:and 97:and 67:path 580:$ Y 576:$ W 565:$ P 561:$ O 459:In 356:by 346:$ w 342:$ W 324:or 314:$ W 304:$ P 231:4NT 186:PWD 178:). 162:or 155:pwd 139:or 112:DOS 56:BSD 30:In 1080:: 1041:. 1037:. 1033:. 1010:. 1006:. 1002:. 961:. 957:. 883:^ 815:^ 796:. 786:. 762:^ 741:. 721:. 692:. 666:; 650:^ 633:. 629:. 574:, 552:^ 539:' 456:. 277:/B 259:CD 229:, 225:, 213:, 209:, 194:CD 172:cd 160:CD 136:CD 85:. 1052:. 1021:. 980:. 965:( 943:. 910:. 877:. 844:. 804:. 756:. 707:. 676:. 644:. 105:. 20:)

Index

Current Directory Structure
computing
process
directory
hierarchical file system
BSD
path
root directory
cd (command)
operating system shell
DOS
UNIX
command shells
Microsoft Windows
cmd.exe
Windows PowerShell
CD
CHDIR
commands
Unix shells
pwd
arguments
home directory
environment variable
pseudo-environment variables
CD
COMMAND.COM
cmd.exe
4DOS
4OS2

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.