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 Message-ID: X-Originating-Email: [cyril_bonnard AT hotmail DOT com] X-Sender: cyril_bonnard AT hotmail DOT com In-Reply-To: <20050823134327.GR17452@calimero.vinschen.de> From: "cyril bonnard" To: cygwin AT cygwin DOT com Subject: Re: Unable to read/write to a tape with tar Date: Wed, 24 Aug 2005 07:18:59 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed X-IsSubscribed: yes Hello! it works! actually i changed the driver (archqic.sys instead of qic157.sys) and reading and writing is ok. So u were right the driver was the pb! Cyril >From: Corinna Vinschen >Reply-To: cygwin AT cygwin DOT com >To: cygwin AT cygwin DOT com >Subject: Re: Unable to read/write to a tape with tar >Date: Tue, 23 Aug 2005 15:43:27 +0200 > >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/ > -- 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/