in reply to Re^3: From File to at Sectors on harddrive (Windows)
in thread From File to at Sectors on harddrive (Windows)
You can simplify your error handling. This:
DeviceIoControl($fh, FSCTL_GET_RETRIEVAL_POINTERS, $inBuf,length($inBuf), $outBuf,length($outBuf), $dwBytesReturned, []); my $error = Win32::GetLastError(); print "error-no: $error\n"; warn "DeviceIoControl->Call: ", Win32::FormatMessage($error) if ($er +ror);
can be replaced by:
DeviceIoControl($fh, FSCTL_GET_RETRIEVAL_POINTERS, $inBuf,length($inBuf), $outBuf,length($outBuf), $dwBytesReturned, [] ) or warn sprintf "DeviceIOControl failed with (%d) '%s'\n", $^E, $^E;
|
|---|