/Win32API-File

Perl programming module for low-level access to Win32 system API calls for files/dirs.

Primary LanguagePerl

Win32API::File v0.1202 -- Low-level access to Win32 API calls for files.

New since v0.07:

	GetHandleInformation	SetHandleInformation
	HANDLE_FLAG_INHERIT	HANDLE_FLAG_PROTECT_FROM_CLOSE
	fileConstant		fileLastError

Low-level and full-power access to the following routines are provided:

	CloseHandle		CopyFile		CreateFile
	DefineDosDevice		DeleteFile		DeviceIoControl
	GetDriveType		GetFileType		GetHandleInformation
	GetLogicalDrives	GetLogicalDriveStrings	GetVolumeInformation
	IsRecognizedPartition	IsContainerPartition	MoveFile
	MoveFileEx		QueryDosDevice		ReadFile
	SetFilePointer		SetErrorMode		SetHandleInformation
	WriteFile

Plus the Unicode versions:

	CopyFileW		CreateFileW		DefineDosDeviceW
	DeleteFileW		GetDriveTypeW		GetLogicalDriveStringsW
	GetVolumeInformationW	MoveFileW		MoveFileExW
	QueryDosDeviceW

Full conversion between Win32-native file handles and Perl file handles is
also supported.  Access to the following C run-time library routines [or at
least the Perl run-time library wrappers for them] is provided:

	_get_osfhandle or win32_get_osfhandle	as FdGetOsFHandle		
	_open_osfhandle or win32_open_osfhandle	as OsFHandleOpenFd		

The following Perl-friendly wrappers and helper functions are also provided:

	OsFHandleOpen		GetOsFHandle		attrLetsToBits
	createFile		fileConstant		fileLastError
	getLogicalDrives

Plus the following constants:

	CREATE_ALWAYS		CREATE_NEW		FILE_BEGIN
	FILE_CURRENT		FILE_END		INVALID_HANDLE_VALUE
	OPEN_ALWAYS		OPEN_EXISTING		TRUNCATE_EXISTING

	DDD_EXACT_MATCH_ON_REMOVE			DDD_RAW_TARGET_PATH
	DDD_REMOVE_DEFINITION

	DRIVE_UNKNOWN		DRIVE_NO_ROOT_DIR	DRIVE_REMOVABLE
	DRIVE_FIXED		DRIVE_REMOTE		DRIVE_CDROM
	DRIVE_RAMDISK

	FILE_READ_DATA			FILE_LIST_DIRECTORY
	FILE_WRITE_DATA			FILE_ADD_FILE
	FILE_APPEND_DATA		FILE_ADD_SUBDIRECTORY
	FILE_CREATE_PIPE_INSTANCE	FILE_READ_EA
	FILE_WRITE_EA			FILE_EXECUTE
	FILE_TRAVERSE			FILE_DELETE_CHILD
	FILE_READ_ATTRIBUTES		FILE_WRITE_ATTRIBUTES
	FILE_ALL_ACCESS			FILE_GENERIC_READ
	FILE_GENERIC_WRITE		FILE_GENERIC_EXECUTE

	FILE_ATTRIBUTE_ARCHIVE		FILE_ATTRIBUTE_COMPRESSED
	FILE_ATTRIBUTE_HIDDEN		FILE_ATTRIBUTE_NORMAL
	FILE_ATTRIBUTE_OFFLINE		FILE_ATTRIBUTE_READONLY
	FILE_ATTRIBUTE_SYSTEM		FILE_ATTRIBUTE_TEMPORARY

	FILE_FLAG_BACKUP_SEMANTICS	FILE_FLAG_DELETE_ON_CLOSE
	FILE_FLAG_NO_BUFFERING		FILE_FLAG_OVERLAPPED
	FILE_FLAG_POSIX_SEMANTICS	FILE_FLAG_RANDOM_ACCESS
	FILE_FLAG_SEQUENTIAL_SCAN	FILE_FLAG_WRITE_THROUGH

	FILE_SHARE_DELETE	FILE_SHARE_READ		FILE_SHARE_WRITE

	FILE_TYPE_CHAR		FILE_TYPE_DISK		FILE_TYPE_PIPE
	FILE_TYPE_UNKNOWN

	FS_CASE_IS_PRESERVED		FS_CASE_SENSITIVE
	FS_UNICODE_STORED_ON_DISK	FS_PERSISTENT_ACLS 
	FS_FILE_COMPRESSION		FS_VOL_IS_COMPRESSED

	HANDLE_FLAG_INHERIT		HANDLE_FLAG_PROTECT_FROM_CLOSE

	IOCTL_STORAGE_CHECK_VERIFY	IOCTL_STORAGE_MEDIA_REMOVAL
	IOCTL_STORAGE_EJECT_MEDIA	IOCTL_STORAGE_LOAD_MEDIA
	IOCTL_STORAGE_RESERVE		IOCTL_STORAGE_RELEASE
	IOCTL_STORAGE_FIND_NEW_DEVICES	IOCTL_STORAGE_GET_MEDIA_TYPES

	IOCTL_DISK_GET_DRIVE_GEOMETRY	IOCTL_DISK_GET_PARTITION_INFO
	IOCTL_DISK_SET_PARTITION_INFO	IOCTL_DISK_GET_DRIVE_LAYOUT
	IOCTL_DISK_SET_DRIVE_LAYOUT	IOCTL_DISK_VERIFY
	IOCTL_DISK_FORMAT_TRACKS	IOCTL_DISK_REASSIGN_BLOCKS
	IOCTL_DISK_PERFORMANCE		IOCTL_DISK_IS_WRITABLE
	IOCTL_DISK_LOGGING		IOCTL_DISK_FORMAT_TRACKS_EX
	IOCTL_DISK_HISTOGRAM_STRUCTURE	IOCTL_DISK_HISTOGRAM_DATA
	IOCTL_DISK_HISTOGRAM_RESET	IOCTL_DISK_REQUEST_STRUCTURE
	IOCTL_DISK_REQUEST_DATA

	GENERIC_ALL			GENERIC_EXECUTE
	GENERIC_READ			GENERIC_WRITE

	Unknown			F5_1Pt2_512		F3_1Pt44_512
	F3_2Pt88_512		F3_20Pt8_512		F3_720_512
	F5_360_512		F5_320_512		F5_320_1024
	F5_180_512		F5_160_512		RemovableMedia
	FixedMedia		F3_120M_512

	MOVEFILE_COPY_ALLOWED		MOVEFILE_DELAY_UNTIL_REBOOT
	MOVEFILE_REPLACE_EXISTING	MOVEFILE_WRITE_THROUGH

	SECURITY_ANONYMOUS		SECURITY_CONTEXT_TRACKING
	SECURITY_DELEGATION		SECURITY_EFFECTIVE_ONLY
	SECURITY_IDENTIFICATION		SECURITY_IMPERSONATION
	SECURITY_SQOS_PRESENT

	SEM_FAILCRITICALERRORS		SEM_NOGPFAULTERRORBOX
	SEM_NOALIGNMENTFAULTEXCEPT	SEM_NOOPENFILEERRORBOX

	PARTITION_ENTRY_UNUSED		PARTITION_FAT_12
	PARTITION_XENIX_1		PARTITION_XENIX_2
	PARTITION_FAT_16		PARTITION_EXTENDED
	PARTITION_HUGE			PARTITION_IFS
	PARTITION_FAT32			PARTITION_FAT32_XINT13
	PARTITION_XINT13		PARTITION_XINT13_EXTENDED
	PARTITION_PREP			PARTITION_UNIX
	VALID_NTFT			PARTITION_NTFT

Comments, additions, and bug reports are welcomed.  Please address
technical questions that are not full bug reports to 

http://perlmonks.org/index.pl?node=Seekers%20of%20Perl%20Wisdom

Tye McQueen, tye@metronet.com, http://perlmonks.org/?node=tye.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.