473,387 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Opening a tape device in Linux?

Hello everyone,

I'm just wondering if there is any way that I could directly open a tape device in linux (i.e. /dev/nst0) to see if it exists..
Can I do such thing in C++?
Or should I be doing this in Python...?

Any suggestions would be greatly appreciated.
Oct 18 '07 #1
2 1826
sicarie
4,677 Expert Mod 4TB
Are you trying to script this? What is the end goal? If you're trying to make some sort of backup program, you should look into the Linux API (In this post there are a few Linux API links), but if you're just looking for a daily script, this would be much easier to do with a shell script...
Oct 19 '07 #2
Are you trying to script this? What is the end goal? If you're trying to make some sort of backup program, you should look into the Linux API (In this post there are a few Linux API links), but if you're just looking for a daily script, this would be much easier to do with a shell script...
I already have the backup system coded in c++ and python (using mt, mtx, tar..etc).. To tell you about the background a little: The system reads some values from configuration file.. I realized that it would be easier to let users write on the configuration file which tape device they would like to use to do the backup. Also, the system checks if all of the information in the config file is valid (i.e. checks if the directories listed on the file really exist.. etc).
But when I tried to implement functionality (in c++) that could check if the listed tape device really exists, I could not find any helpful information..
The device doesn't quite behave like a file, or like a directory..
(I tried treating it like a file and a directory without any luck.)

So I'm wondering if there is any way for me to open the tape device from C++.
I know that in C, we can open anything with 'open' system call, but I'm not quite familiar with system calls in C++..

Thank you so much... (Thank you so much for the Links also. I'm looking at them right now!)
Oct 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Josh Smith | last post by:
In Python 2.3 there is a new library for handling tarfiles. However, there doesn't seem to be any documentation on handling end-of-tape conditions. I've googled for it and checked the docs, I've...
6
by: A.Y. Xu | last post by:
Environment: Win Server 2003 Standard Version, SQL Server 2000, HP DDS3 Tape(local). Backup procedure: 1. open SQL Server Enterprise Manager 2. find the database i want to backup 3. right click...
8
by: nek | last post by:
Greetings, Has anyone got the latest progress on this? It hit me this time on W2K running DB2 V8.1.5. It returned the following warning: D:\Temp>db2 backup db sample to \\localhost\tape0...
2
by: Charles Law | last post by:
I am looking for a way to manipulate a tape device from within .NET. I see there is the ManagementClass, which I think others have mentioned before, but it is not clear at the moment whether this...
0
by: pjbr34 | last post by:
Hi everyone, I am running DB2 8.2 under SuSE SLES9 (zSeries). My current problem is when trying to make a direct backup to tape. - I can make a DB2 backup to a filesystem and it works fine....
3
by: Kush | last post by:
Hi. I want to do a db backup to tape. I looked thru the command reference and it just says "to tape". I don't know how to reference the tape drive on windows as it is not assigned a drive...
1
by: Akaketwa | last post by:
Guys may yu assist me am stuck. Am using v8.1 db2 database on Suse Linux running on an IBM pSeries server. I am aware of the backup utility in db2. I would like to back up the my db2 database to a...
2
by: Divakar | last post by:
Hi All, We are trying to restore a backup that we took last night on a fresh new Tape. The backup was successful but the restore is failing with the following error: db2 =restore db gpiecuk...
1
by: Sam Marrocco | last post by:
Has anyone every used VB.net to control/write/read a tape device such as LTO or SDLT? I'd like to be able to write a TAR utility within vb.net that write to the tape device. Any suggestions?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.