Firestreamer and Win32 API: CreateFile and PrepareFile

The technical support forum for Firestreamer (the virtual tape library).
Locked
jfneis
Posts: 2
Joined: 27 Nov 2012, 00:40

Post by jfneis »

Hi all,

I'm trying to use Firestreamer as a way to facilitate the development of a backup feature in our software, so I don't need to use a real tape library every time.

To develop this feature, I'm using two main Windows API methods until now: CreateFile and PrepareTape of the windows API.

Well, I won't go in details about the API usage because I know that this isn't the place for it but, instead of it, I'd like to understand better the behavior of Firestreamer.

Basically, the problem that I'm facing now is: I can instantiate the tape "handler" through the CreateFile method, where I use the tape symbolic name that I get via Device Manager in a patter like "\\.\Tape1". Until there, OK.

The problem is, when I call the second method, Windows give me an error saying that the media isn't OK. What is interesting is that, inside Firestreamer, in the Activity tab, 2 messages are displayed:

11/26/2012 22:33:19 | Error | E025 | L1T001 | Unable to insert the medium [] into a tape drive: The medium URI prefix is invalid. | |
11/26/2012 22:33:19 | Error | E010 | L1T001 | Unable to read data from the medium. | |

OK, so from it I understand that as I'm specifying only the Tape name, but not the tape cartridge identification (the medium, in this case), Firestreamer (or maybe any tape library engine, I'm far from an expert in this subject) doesn't understand which medium it should use to write my data.

Based on this line of thought, my doubts are:

1. Is there a format that allows me to specify, in the Windows Format, which medium to use? Or
2. Is there a way I can configure Firestreamer so it behaves as a single single tape drive and not a tape library? I mean, it always will have only one tape drive that will always have one medium inside it, so I don't have to "tell it" to load the tape before I can read/write to it?

I hope I could make my question clear.

Thhank you in advance,

Filipe
jsf
Cristalink Support
Posts: 300
Joined: 29 Aug 2010, 09:03

Post by jsf »

>>Unable to insert the medium [] into a tape drive
You need to use a valid tape name in the media layout, like file://c:\mytape.fsrm, and the file must exist.

>>1. Is there a format that allows me to specify, in the Windows Format, which medium to use
See http://www.cristalink.com/fs/hh.aspx?id=auto. You can also use DeviceIoControl(), but we don't have public documentation for it. We can provide details, as long as you have a valid purchased license for Firestreamer.

>>2. Is there a way I can configure Firestreamer so it behaves as a single single tape drive and not a tape library
The next version of Firestreamer will allow it, but it shouldn't matter for your purposes. Just load tape directly into a tape drive, and use the tape drive.
Best regards,
John Smith
Cristalink Support
jfneis
Posts: 2
Joined: 27 Nov 2012, 00:40

Post by jfneis »

Thank you John.

I'll try to load the tape in the tape drive via Firestreamer API and then use the regular Win32 API methods to write to it.

Thank you in advance.

Filipe
Locked