Unable to read/write to a tape with tar

cyril bonnard cyril_bonnard@hotmail.com
Wed Aug 24 07:19:00 GMT 2005


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 <corinna-cygwin@cygwin.com>
>Reply-To: cygwin@cygwin.com
>To: cygwin@cygwin.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 <stdio.h>
>#include <windows.h>
>
>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@cygwin.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/



More information about the Cygwin mailing list