Hi All, I trying to write a program that will write to tape, but i can't seem to get it to work correctly. i have attached a simple piece of source code that will open a file (or device) and write the string "hello, tape". This program will work with a file, and a floppy device, but not a tape device. can anyone give me some pointers? what do i have to do differently to write to tape? Thanks, --brad
On Wed, Jul 17, 2002 at 08:36:16PM -0400, Brad Noyes wrote:
This program will work with a file, and a floppy device, but not a tape device.
can anyone give me some pointers? what do i have to do differently to write to tape?
I've never used tape before, but I know tape is not quite as ambidextrous as a file or floppy device. So, instead of O_RDWR | O_CREAT | O_TRUNC, I'd try a simple O_WRONLY. Or other things. Maybe. -Chuck
try to get rid of the O_TRUNC to see if it might help <from `man dd`> Often a tape drive will not accept arbitrarily sized blocks, and dd would get an I/O error for the last fragment of data that does not fill an entire block. Use `dd if=myfile of=/dev/mytape conv=sync' to get everything on tape. Of course, reading it back will now produce a slightly larger file, with nulls added at the end. </from `man dd`> -mike ----- Original Message ----- From: "Chuck Homic" <chuck@vvisions.com> To: <wlug@mail.wlug.org> Sent: Wednesday, July 17, 2002 8:46 PM Subject: Re: [Wlug] writing to tape
On Wed, Jul 17, 2002 at 08:36:16PM -0400, Brad Noyes wrote:
This program will work with a file, and a floppy device, but not a tape device.
can anyone give me some pointers? what do i have to do differently to write to tape?
I've never used tape before, but I know tape is not quite as ambidextrous as a file or floppy device.
So, instead of O_RDWR | O_CREAT | O_TRUNC, I'd try a simple O_WRONLY. Or other things. Maybe.
-Chuck _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
THANKS!!! the problem was solved by writing/reading in 512 byte chucks. I did try serveral different flags to open(), and they seemed to work. thanks chuck and michael, --brad On Wed, Jul 17, 2002 at 09:03:27PM -0400, Michael Frysinger wrote:
try to get rid of the O_TRUNC to see if it might help <from `man dd`> Often a tape drive will not accept arbitrarily sized blocks, and dd would get an I/O error for the last fragment of data that does not fill an entire block. Use `dd if=myfile of=/dev/mytape conv=sync' to get everything on tape. Of course, reading it back will now produce a slightly larger file, with nulls added at the end. </from `man dd`> -mike
----- Original Message ----- From: "Chuck Homic" <chuck@vvisions.com> To: <wlug@mail.wlug.org> Sent: Wednesday, July 17, 2002 8:46 PM Subject: Re: [Wlug] writing to tape
On Wed, Jul 17, 2002 at 08:36:16PM -0400, Brad Noyes wrote:
This program will work with a file, and a floppy device, but not a tape device.
can anyone give me some pointers? what do i have to do differently to write to tape?
I've never used tape before, but I know tape is not quite as ambidextrous as a file or floppy device.
So, instead of O_RDWR | O_CREAT | O_TRUNC, I'd try a simple O_WRONLY. Or other things. Maybe.
-Chuck _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
_______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
Brad Noyes wrote:
512 byte chucks.
How do you get the byte size of a chuck? just a guess. For some reason 512 bytes stuck in my head as a block size so i
On Thu, Jul 18, 2002 at 09:39:48PM -0400, doug waud wrote: tried it and it worked. i did some more looking and i found some info on how tar handles things http://www.gnu.org/manual/tar/html_node/tar_130.html And this site give some good information on block sizes and tapes, under the "BLOCK SIZES" section http://www.faqs.org/faqs/aix-faq/part2/section-1.html also in mt's man page, there is an option to set the block size (setblk), which only works for scsi tapes.
For example, if we pipe Homic and/or Anderson to chucksize what would the output be?
i don't understand what your asking here. --brad
On Fri, Jul 19, 2002 at 10:39:49AM -0400, Brad Noyes wrote:
512 byte chucks.
For example, if we pipe Homic and/or Anderson to chucksize what would the output be?
i don't understand what your asking here.
I believe the chucksize would be one, even if they're different. It's like one of my WPI roommates who was always exactly one Pete tall. I guess that's a benefit of being the standard for a unit of measurement. Even if you change relative to everything else, you're still exactly one of your measurement unit in size. -- Randomly Generated Tagline: "Any similarity to person/persons now living to anyone or thing, dead or undead, is entirely accidental and just one more irrefutable proof of the paranormal." - From the 7th Guest
On Fri, 19 Jul 2002 10:44:52 -0400 Theo Van Dinter <felicity@kluge.net> wrote: TVD> I believe the chucksize would be one, even if they're different. TVD> It's like one of my WPI roommates who was always exactly one Pete TVD> tall. I guess that's a benefit of being the standard for a unit of TVD> measurement. Even if you change relative to everything else, you're TVD> still exactly one of your measurement unit in size. ...which is not to be confused with the Candy Bar Scale.... <evil grin> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- William Smith wsmith-at-chezsmith-dot-com Fall River, MA http://www.chezsmith.com Therapy is expensive. Popping bubblewrap is cheap. You choose. * TAG! v3.0 *
On Fri, 19 Jul 2002 10:39:49 -0400 Brad Noyes <maitre@ccs.neu.edu> wrote: BN> On Thu, Jul 18, 2002 at 09:39:48PM -0400, doug waud wrote: BN> > Brad Noyes wrote: BN> > > BN> > > 512 byte chucks. BN> > BN> > How do you get the byte size of a chuck? BN> just a guess. For some reason 512 bytes stuck in my head as a block BN> size so i tried it and it worked. BN> BN> i did some more looking and i found some info on how tar handles BN> things http://www.gnu.org/manual/tar/html_node/tar_130.html BN> BN> And this site give some good information on block sizes and tapes, BN> under the"BLOCK SIZES" section BN> http://www.faqs.org/faqs/aix-faq/part2/section-1.html BN> BN> also in mt's man page, there is an option to set the block size BN> (setblk), which only works for scsi tapes. BN> BN> > BN> > For example, if we pipe Homic and/or Anderson to chucksize BN> > what would the output be? BN> > BN> i don't understand what your asking here. re-read what you said, then take a look at the man page. what you're referring to was BLOCK size, but you said "chuck".... <g> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- William Smith wsmith-at-chezsmith-dot-com Fall River, MA http://www.chezsmith.com If you have the right attitude, interesting problems will find you. -- ESR * TAG! v3.0 *
Brad Noyes wrote:
Brad Noyes wrote:
512 byte chucks.
How do you get the byte size of a chuck? just a guess. For some reason 512 bytes stuck in my head as a block size so i
On Thu, Jul 18, 2002 at 09:39:48PM -0400, doug waud wrote: tried it and it worked.
i did some more looking and i found some info on how tar handles things http://www.gnu.org/manual/tar/html_node/tar_130.html
And this site give some good information on block sizes and tapes, under the "BLOCK SIZES" section http://www.faqs.org/faqs/aix-faq/part2/section-1.html
also in mt's man page, there is an option to set the block size (setblk), which only works for scsi tapes.
For example, if we pipe Homic and/or Anderson to chucksize what would the output be?
i don't understand what your asking here.
I guess I should restate the question: How do you guess the byte size of a chuck? :-) (I was using that typo to have fun with Homic and Anderson) Sorry, I did not intend to be taken seriously; normally nobody does! :-) doug
On Fri, Jul 19, 2002 at 01:24:05PM -0400, doug waud wrote:
I guess I should restate the question: How do you guess the byte size of a chuck? :-)
(I was using that typo to have fun with Homic and Anderson)
Funny, no one who commits this typo seems to ever notice. A cow-orker of mine once said, "It's a lot of work, but I'll take a large chuck." And I continued the thread for a bit, discussing what chuck of work everyone would be doing and no one noticed. Incidentally, when I got email from Fr. Scanlon, I was often referred to as Chuch. Funny that finger memory. :) As long as it's not an upchuck joke... -Chunk
On Fri, Jul 19, 2002 at 01:24:05PM -0400, doug waud wrote:
Brad Noyes wrote:
Brad Noyes wrote:
512 byte chucks.
How do you get the byte size of a chuck? just a guess. For some reason 512 bytes stuck in my head as a block size so i
On Thu, Jul 18, 2002 at 09:39:48PM -0400, doug waud wrote: tried it and it worked.
i did some more looking and i found some info on how tar handles things http://www.gnu.org/manual/tar/html_node/tar_130.html
And this site give some good information on block sizes and tapes, under the "BLOCK SIZES" section http://www.faqs.org/faqs/aix-faq/part2/section-1.html
also in mt's man page, there is an option to set the block size (setblk), which only works for scsi tapes.
For example, if we pipe Homic and/or Anderson to chucksize what would the output be?
i don't understand what your asking here.
I guess I should restate the question: How do you guess the byte size of a chuck? :-)
(I was using that typo to have fun with Homic and Anderson)
Sorry, I did not intend to be taken seriously; normally nobody does! :-)
heheh, i didn't even notice that typo! I have a reputation at work for creating very subtle typos, which change the meaning of a sentence completely, in messages i send out to the whole company or department. oh well. i should have know that coming from you doug. --brad
participants (6)
-
Bill Smith
-
Brad Noyes
-
Chuck Homic
-
doug waud
-
Michael Frysinger
-
Theo Van Dinter