Platform/File(장치 IO)
-
WindowsPlatform/File(장치 IO) 2010. 11. 15. 00:14
CreateFile() GENERIC_READ GENERIC_WRITE FILE_SHARE_READ FILE_SHARE_WRITE CREATE_NEW CREATE_ALWAYS OPEN_EXISTING TRUNCATE_EXISTING GENERIC_WRITE OPEN_ALWAYS CREATE_NEW FILE_FLAG_OVERLAPPED CloseHandle() GetStdHandle() ReadFile() WriteFile() The function starts writing data to the file at the position indicated by the file pointer. After the write operation has been completed, the file pointer is ..
-
POSIX(UNIX)Platform/File(장치 IO) 2010. 3. 16. 00:21
UNIX files, no matter what program created them, can all be accessed as a sequential stream of bytes. When you access a file, you start by opening it by name. The operating system then gives you a number, called a file descriptor, which you use to refer to the file until you are through with it. You can then read and write to the file using its file descriptor. When you are done reading and writ..
-
INI 파일Platform/File(장치 IO) 2009. 11. 29. 22:58
WritePrivateProfileString() GetPrivateProfileInt() LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam) { switch (iMessage) { case WM_CREATE: { TCHAR str[128]; TCHAR drive[_MAX_DRIVE]; TCHAR dir[MAX_PATH]; TCHAR path[256]; RECT rt; GetModuleFileName(NULL,str,128); _splitpath(str,drive,dir,NULL,NULL); strcpy(path, drive); strcat(path, dir); strcat(path, "IniFile.ini"); rt..
-
시리얼 포트 - Win32Platform/File(장치 IO) 2009. 5. 18. 17:03
CreateFile() CloseHandle() GetCommState() SetCommState() SetCommTimeouts() WriteFile() HWND hWndCopy; // 스레드를 위한 핸들의 카피 HANDLE hFile; // 파일 핸들 int g_nSwitch; // 읽어오기 전용 스레드 DWORD RecvData( VOID * dummy ) { DWORD dwByte; char szRecv[10]; int nRet; while (g_nSwitch) { // 한 문자 수신 nRet = ReadFile(hFile, szRecv, 1, &dwByte, 0); // ReadFile()은 성공하면 0이외를 반환, 타임아웃도 성공 if (dwByte == 1) { SetWindowText(hW..
-
파일 시스템 - MFCPlatform/File(장치 IO) 2009. 2. 4. 22:40
CFtpConnection .GetCurrentDirectory() .SetCurrentDirectory() .OpenFile() .Remove() CFileFind .FindFile() .FindNextFile() .IsDirectory() .IsDots() .GetFilePath() .GetFileName() // 폴더나 드라이브가 존재하는지 검사 BOOL IsFolder(CString &strFileLocation) { CFileFind cFile; BOOL b; if(strFileLocation.GetLength()
-
레지스트리 - Win32Platform/File(장치 IO) 2009. 2. 4. 21:46
RegOpenKeyEx() RegCreateKeyEx() HKEY_CURRENT_USER HKEY_LOCAL_MACHINE KEY_WRITE KEY_READ RegCloseKey() RegDeleteKey() RegQueryInfoKey() RegEnumKeyEx() RegEnumValue() ERROR_NO_MORE_ITEMS RegEnumValueEx() RegSetValueEx() REG_SZ RegDeleteValue() RegQueryValueEx() SHDeleteKey() #define MAX_KEY_LENGTH 255 #define MAX_VALUE_NAME 16383 static void QueryKey(HKEY hKey) { TCHAR achKey[MAX_KEY_LENGTH]; // b..
-