[NTLUG:Discuss] problem w/ copying to a floppy drive
kbrannen@gte.net
kbrannen at gte.net
Fri May 31 22:43:21 CDT 2002
David Stanaway wrote:
> On Thu, 2002-05-30 at 01:00, Steve Baker wrote:
>
>>Fred James wrote:
>>
>>>Gosh, you stopped me there. Doesn't everything have to have a file
>>>system? Except maybe stuff like dd - can dd work without a file system?
>>
>>You can access drives as raw character devices - it's just like there
>>is one big file called /dev/fd0. Just about anything you could do to
>>a file, you can do to /dev/fd0.
>
>
> I think you mean Block devices. Character devices are things like sound
> cards, mice, keyboards, serial ports, tape drives, agpgart etc...
>
> The problem with using /dev/fd0 is when you write to it, the device
> driver doesn't handle something like and end of file mark (Like a tape
> drive does). So if you want to write to that raw device, it needs to be
> in a format that has some kind of end of file marker so that when you
> need to read it, it doesn't break when it gets to the junk after the
> data that you wrote.
>
> I am not sure if tar is such a format. I think I tried that once, but
> it gave errors when I tried to read it with the junk at the end of the
> disk.
>
...
> Conclusion.
>
> Using the described methods should work fine with tar. But don't expect
> to have a good time accessing the info on a windows machine... I think
> there was a dos command: diskcopy that you could use to rip the raw disk
> image, then you can rename the raw image to .tar and use winzip, or the
> cygwin gnutar to read it.
Yes, tar will work fine that way. It and cpio both have a format like:
header
data
header
data
...
empty/special header to mark the end
or something like that. It's been awhile since I've looked at the code.
Anyway, try doing a more/less on a tar file (of text files). You'll see a
some strange chars at the beginning of every file (which a C struct written in
binary mode, but it does have the file name in it), then the actual file.
HTH,
Kevin
More information about the Discuss
mailing list