Скачать презентацию
Идет загрузка презентации. Пожалуйста, подождите
Презентация была опубликована 8 лет назад пользователемАнтон Окулов
1 Filesystem Windows
2 File Pointers DWORD SetFilePointer ( HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod)
3 File Pointers hFile is the handle of an open file with read or write access (or both). hFile is the handle of an open file with read or write access (or both). lDistanceToMove is the 32-bit LONG signed distance to move or unsigned file position, depending on the value of dwMoveMethod. lDistanceToMove is the 32-bit LONG signed distance to move or unsigned file position, depending on the value of dwMoveMethod. dwMoveMethod specifies one of three move modes dwMoveMethod specifies one of three move modes (FILE_BEGIN, FILE_CURRENT, FILE_END ) (FILE_BEGIN, FILE_CURRENT, FILE_END )
4 Getting the File Size DWORD GetFileSize ( HANDLE hFile, LPDWORD lpFileSizeHigh) DWORD GetFileSize ( HANDLE hFile, LPDWORD lpFileSizeHigh) Return: The low-order component of the file size. 0xFFFFFFFF indicates a possible error; check GetLastError.
5 File Attributes and Directory Processing HANDLE FindFirstFile ( LPCTSTR lpFileName, LPWIN32_FIND_DATA lpffd) HANDLE FindFirstFile ( LPCTSTR lpFileName, LPWIN32_FIND_DATA lpffd) Return: A search handle. INVALID_HANDLE_VALUE indicates failure. FindFirstFile examines both subdirectory and file names, looking for a name match. The returned HANDLE is used in subsequent searches.
6 File Attributes and Directory Processing lpffd points to a WIN32_FIND_DATA structure that contains information about the first file or directory to satisfy the search criteria, if any are found. lpffd points to a WIN32_FIND_DATA structure that contains information about the first file or directory to satisfy the search criteria, if any are found.
7 WIN32_FIND_DATA typedef struct_WIN32_FIND_DATA { DWORD dwFileAttributes; DWORD dwFileAttributes; FILETIME ftCreationTime; FILETIME ftCreationTime; FILETIME ftLastAccessTime; FILETIME ftLastAccessTime; FILETIME ftLastWriteTime; FILETIME ftLastWriteTime; DWORD nFileSizeHigh; DWORD nFileSizeHigh; DWORD nFileSizeLow; DWORD nFileSizeLow; DWORD dwReserved0; DWORD dwReserved0; DWORD dwReserved1; DWORD dwReserved1; TCHAR cFileName [MAX_PATH]; TCHAR cFileName [MAX_PATH]; TCHAR cAlternateFileName [14]; TCHAR cAlternateFileName [14]; } WIN32_FIND_DATA;
8 Find next file and close search handle BOOL FindNextFile ( HANDLE hFindFile, LPWIN32_FIND_DATA lpffd) BOOL FindClose (HANDLE hFindFile)
9 Mount points SetVolumeMountPoint mounts a drive (the second argument) at the point specified by the first argument. SetVolumeMountPoint mounts a drive (the second argument) at the point specified by the first argument. SetVolumeMountPoint ("C:\\mycd\\", "D:\\");
10 File locking An important issue in any system with multiple processes is coordination and synchronization of access to shared objects, such as files. An important issue in any system with multiple processes is coordination and synchronization of access to shared objects, such as files. Windows can lock files, in whole or in part, so that no other process (running program) can access the locked file region. File locks can be read-only (shared) or read-write (exclusive). Windows can lock files, in whole or in part, so that no other process (running program) can access the locked file region. File locks can be read-only (shared) or read-write (exclusive).
11 File locking BOOL LockFileEx ( BOOL LockFileEx ( HANDLE hFile, HANDLE hFile, DWORD dwFlags, DWORD dwFlags, DWORD dwReserved, DWORD dwReserved, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped) DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped)
12 File unlocking BOOL UnlockFileEx ( BOOL UnlockFileEx ( HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped) HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped)
Еще похожие презентации в нашем архиве:
© 2024 MyShared Inc.
All rights reserved.