<!DOCTYPE html>
<html class="client-js"><head>
  <meta charset="UTF-8">
  <title>Direct.h</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script>
    function importScript() { return 1 } // this is to avoid the error from site.js
  </script>
  <script>let articleId = 'Direct.h'</script>
  <link rel="canonical" href="https://en.wikipedia.org/wiki/Direct.h">
  <link href="../-/mw/ext.cite.ux-enhancements.css" rel="stylesheet" type="text/css">
<link href="../-/mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="../-/mw/skins.minerva.base.reset|skins.minerva.content.styles|ext.cite.style|site.styles|mobile.app.pagestyles.android|mediawiki.page.gallery.styles|mediawiki.skinning.content.parsoid.css" rel="stylesheet" type="text/css">
  <link href="../-/style.css" rel="stylesheet" type="text/css"><link href="../-/content.parsoid.css" rel="stylesheet" type="text/css"><link href="../-/inserted_style.css" rel="stylesheet" type="text/css">
  <script src="../-/script.js"></script><script src="../-/masonry.min.js"></script><script src="../-/article_list_home.js"></script><script src="../-/images_loaded.min.js"></script><script src="../-/node_module/details-element-polyfill/dist/details-element-polyfill.js"></script>
</head>

<body class="mediawiki mw-hide-empty-elt ns-0 ns-subject stable skin-minerva action-view animations">
  <div id="mw-mf-viewport" class="feature-header-v2">
    <div id="mw-mf-page-center">
      <div id="content" class="mw-body">
        <a id="top"></a>
        <div id="bodyContent" class="content mw-parser-output">
          
          <div id="mw-content-text" style="direction: ltr;"><h1 class="section-heading" tabindex="0" aria-haspopup="true" data-section-id="0">
  <span class="mw-headline" id="title_0">Direct.h</span>
</h1>
<div id="mf-section-0" class="mf-section-0" aria-pressed="true" aria-expanded="true">
  <p><b>direct.h</b> is a <a href="C_(programming_language)" title="C (programming language)">C</a>/<a href="C%2B%2B" title="C++">C++</a> <a href="Header_file" title="Header file" class="mw-redirect">header file</a> provided by Microsoft Windows, which contains functions for manipulating file system <a href="Directory_(computing)" title="Directory (computing)">directories</a>. Some <a href="POSIX" title="POSIX">POSIX</a> functions that do similar things are in <a href="Unistd.h" title="Unistd.h">unistd.h</a>.</p>


</div><details data-level="2" open="">
    <summary class="section-heading"><h2 id="Member_functions">Member functions</h2></summary>
    

<table class="wikitable">
<tbody><tr>
<th>Name</th><th>Action</th></tr>
<tr>
<td><code>int <b>_chdir</b>(char* path)</code></td><td>Change <a href="Working_directory" title="Working directory">working directory</a>.</td></tr>
<tr>
<td><code>int <b>_chdrive</b>(int drive)</code></td><td>Change disk drive.</td></tr>
<tr>
<td><code>char* <b>_getcwd</b>(char* buffer, size_t length)</code></td><td>Get the current working directory pathname<span class="mw-ref reference" id="cite_ref-1"><a href="#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></span></td></tr>
<tr>
<td><code>char *<b>_getwd</b>(char *path_name);</code></td><td>Get working directory.</td></tr>
<tr>
<td><code>int <b>_getdrive</b>(void)</code></td><td>Get disk drive.</td></tr>
<tr>
<td><code>int <b>_mkdir</b>(const char* pathname)</code></td><td>Make a directory.</td></tr>
<tr>
<td><code>int <b>_rmdir</b>(const char* pathname)</code></td><td>Remove a directory.</td></tr>
<tr>
<td><code>void <b>_fnmerge</b>(char* path, const char* drive, const char* dir, const char* name, const char* ext)</code></td><td>Merges drive, dir, name and ext into path.</td></tr>
<tr>
<td><code>int <b>_fnsplit</b>(const char* path, char* drive, char* dir, char* name, char* ext)</code></td><td>Splits path into drive, dir, name and ext.</td></tr>
<tr>
<td><code>char* <b>_searchpath</b>(const char* file)</code></td><td>Searches for a file.</td></tr>
</tbody></table>


    
</details><details data-level="2" open="">
    <summary class="section-heading"><h2 id="See_also">See also</h2></summary>
    
<ul><li><a href="File_system" title="File system">File system</a></li>
<li><a href="Directory_structure" title="Directory structure">Directory structure</a></li></ul>


    
</details><details data-level="2" open="">
    <summary class="section-heading"><h2 id="References">References</h2></summary>
     
<div class="reflist " style=" list-style-type: decimal;">
<div class="mw-references-wrap"><ol class="mw-references references"><li id="cite_note-1"> <span id="mw-reference-text-cite_note-1" class="mw-reference-text"><cite class="citation web cs1"><a href="http://pubs.opengroup.org/onlinepubs/009695399/functions/getwd.html" class="external text external">"Getwd"</a>.</cite></span></li></ol></div></div>



<style data-mw-deduplicate="TemplateStyles:r999302996">.mw-parser-output cite.citation{font-style:inherit}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .id-lock-free a,.mw-parser-output .citation .cs1-lock-free a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited a,.mw-parser-output .id-lock-registration a,.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription a,.mw-parser-output .citation .cs1-lock-subscription a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-ws-icon a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg")right 0.1em center/12px no-repeat}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-maint{display:none;color:#33aa33;margin-left:0.3em}.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}</style>
    
</details><!--htdig_noindex--><div><div style="clear:both; background-image:linear-gradient(180deg, #E8E8E8, white); border-top: dashed 2px #AAAAAA; padding: 0.5em 0.5em 0.5em 0.5em; margin-top: 1em; direction: ltr;">
    This article is issued from <a class="external text" title="Last edited on 2020-11-06" href="https://en.wikipedia.org/wiki/?title=Direct.h&amp;oldid=987349898">Wikipedia</a>. The text is licensed under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons - Attribution - Sharealike</a>. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
        </div>
      </div>
    </div>
  </div>
  <script src="../-/mw/jsConfigVars.js"></script>
  <script src="../-/mw/startup.js"></script>
<script src="../-/mw/jquery.js"></script>
<script src="../-/mw/mediawiki.js"></script>
<script src="../-/mw/site.js"></script>
<script src="../-/mw/ext.cite.ux-enhancements.js"></script>



</body></html>