Equivalent to Windows <sys / file.h>

Is there a win32 equivalent for linux header file? I am working on a Linux port for Windows (and for the first time doing this) and it does not work in this file.

+5
source share
3 answers

When writing WIN32API applications, usually #include <windows.h>- this includes most of the Windows API in your application. If you need to cut back on some of them, it will #define WIN32_LEAN_AND_MEANdestroy some of the more obscure things from the Windows libraries.

What features are you trying to convert? This will probably be the case of using another function on WIN32; it is very different from Linux / Unix / POSIX.

: ReadFile() read() , . ReadFile() MSDN :

: WinBase.h( Windows.h)

+4

Windows, , Windows API (CreateFile ..).

, <sys/file.h>, , POSIX, posix.

, posix Windows.

  • C , -, Dev Studio . <stdio.h>, , , fopen.
  • MinGW , Microsoft C-Runtime, , pthreads .
  • Cygwin - POSIX.
  • SUA - Microsoft.
+2

In the interest of posterity <sys/file.h>, this is the BSD version of low-level file I / O routines. Depending on your installation and compiler build environment, you will most likely want to <fcntl.h>. Most of the usual I / O procedures are in <stdio.h>, even setvbuf(), which is a fairly low level of control. You will need <windows.h>or <conio.h>, if you want, I / O routines / settings that usually do not exist on Linux (or other * NICES).

0
source

All Articles