Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Tue, 23 Aug 2005 15:43:27 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Unable to read/write to a tape with tar Message-ID: <20050823134327.GR17452@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20050823113812 DOT GO17452 AT calimero DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i On Aug 23 12:56, cyril bonnard wrote: > Ok, i'll reinstall the driver, the strange thg is that wintar-scsi works > fine !? Since wintar-scsi is a proprietary application, I can't look what it's doing differently. AFAIK, wintar-scsi uses low level calls on the SCSI level. Cygwin uses just standard Win32 function calls. If these fail even though opening the device worked, then I'm stuck. Could you please build this small testcase and run it while a tape in in the drive? ======== SNIP ======= #include #include int main (int argc, char **argv) { HANDLE mt; TAPE_GET_MEDIA_PARAMETERS mp; DWORD ret, size, part, low, high; /* Open tape device */ mt = CreateFile ("\\\\.\\tape0", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (mt == INVALID_HANDLE_VALUE) { fprintf (stderr, "CreateFile: Win32 error %lu\n", GetLastError ()); return 1; } /* Get tape status */ while (ret = GetTapeStatus (mt)) { fprintf (stderr, "GetTapeStatus: Win32 error %lu\n", ret); sleep (1); } /* Get media parameters */ size = sizeof mp; ret = GetTapeParameters (mt, GET_TAPE_MEDIA_INFORMATION, &size, &mp); if (ret) { fprintf (stderr, "GetMediaParameters: Win32 error %lu\n", ret); goto fini; } printf ("Capacity: %lld\n", mp.Capacity); printf ("Remaining: %lld\n", mp.Remaining); printf ("BlockSize: %lu\n", mp.BlockSize); printf ("PartitionCount: %lu\n", mp.PartitionCount); printf ("WriteProtected: %d\n", mp.WriteProtected); fini: CloseHandle (mt); return 0; } ======== SNAP ======= Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/