mirror of
https://github.com/pkivolowitz/asm_book.git
synced 2026-06-21 01:36:47 +08:00
16 lines
No EOL
280 B
C++
16 lines
No EOL
280 B
C++
#include <iostream>
|
|
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
|
|
using std::cout;
|
|
using std::endl;
|
|
using std::hex;
|
|
|
|
int main() {
|
|
int fd = open("test.txt", O_RDWR | O_CREAT, 0666);
|
|
cout << fd << endl;
|
|
cout << hex << (O_RDWR | O_CREAT) << endl;
|
|
if (fd >= 0)
|
|
close(fd);
|
|
return 0;
|
|
} |