Get the App
SLTechnology News&Howtos  ›  Servers  › 

Class unix directory class dirent.h vs20

Shulou Source: shulou.com Published: 2022-06-03 09:07:57 12月06日 Update

There is no dirent.h under windows to download open source implementation.

Http://www.softagalleria.net/dirent.php

But there is no mkdir in this file

But there are _ mkdir (), so in windows direct.h

Where you don't use mkdir, just include dirent.h.

Where mkdir is used.

Replace with

Int creatDIR (char * path)

{

Int result = 0

# if defined (_ WIN32)

Result = _ mkdir (path)

# else

Result = mkdir (path, 0777); / / notice that 777 is different than 0777

# endif

Return result

}

The _ WIN32 macro is defined as the one already defined by vs, which is 1

Tags: Place just file directory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Apple Linux macOS MariaDB