Click to See Complete Forum and Search --> : byte-by-byte
hometown
October 17th, 2003, 04:01 AM
In Uniks system, if I open copy a file to another one, byte-by-byte of the source file will be copied to the sink file right ? How do people know about that ? I mean how can the programmer know it ?
Thanks,
-home
hometown
October 17th, 2003, 04:05 AM
Please be On Topic:(
I would like to know about this...
Thanks ,
khp
October 17th, 2003, 01:37 PM
I hereby declare this posting to be On Topic:(
Allthough I'am not quite sure, what the topic is.
If you make a copy of a file, then yes the source and target file will be exactly the same byte for byte. Except for timestamp, permissions and ownership properties.
What is there not to know ?.
And what programmer would not know it ?, the guy who wrote the copy command ?, or the guy using the copy command.
But why are you asking about unix, are you thinking about moving to a proper operating system ?
Ohh I'am sorry I guess that was Off Topic:)
hometown
October 17th, 2003, 01:52 PM
I really like to hear you say I hereby declare this posting to be On Topic:)
Acutally, my book says so, when copying a file in UNiks system, it will be one byte after another...and I want to know why since the writer says nothing about why but just give out his idea...
Fiona
khp
October 17th, 2003, 02:01 PM
Originally posted by hometown
Acutally, my book says so, when copying a file in UNiks system, it will be one byte after another...and I want to know why since the writer says nothing about why but just give out his idea...
I would think that, the book just says so, as a way of saying that the files are identical copies.
Mick
October 17th, 2003, 02:07 PM
byte by byte a story about canniblism.....what book are you reading homey???
hometown
October 17th, 2003, 02:09 PM
Originally posted by khp
I would think that, the book just says so, as a way of saying that the files are identical copies.
Okay:( ...
By theway, you havenot installed that vb color
:)
cvogt61457
October 17th, 2003, 02:10 PM
Well, a disk reads/writes serially to the platter. Reading or writing
any file is done byte-by-byte.
Making an exact copy would be a byte-by-byte copy.
Probably, the author wanted to make sure that the readers
understand that the copy of the file will be the same as the
original. (Although a "copy" implies that the files will be the same)
hometown
October 17th, 2003, 02:18 PM
Originally posted by cvogt61457
Well, a disk reads/writes serially to the platter. Reading or writing
any file is done byte-by-byte.
Making an exact copy would be a byte-by-byte copy.
Probably, the author wanted to make sure that the readers
understand that the copy of the file will be the same as the
original. (Although a "copy" implies that the files will be the same)
So in Windows and Uniks, it is the same ??? right ?
khp
October 17th, 2003, 02:23 PM
Originally posted by hometown
By theway, you havenot installed that vb color
I'am sorry I never cared much for wierd and hard to read color schemes.
So in Windows and Uniks, it is the same ??? right ?
Yes. although the filesystems used by unix is a bit different whan windows, copying a file effectivly works the same on both windows and unix.
hometown
October 17th, 2003, 02:24 PM
Originally posted by Mick
byte by byte a story about canniblism.....what book are you reading homey???
I am reading about how to make a WINDOWS OS like Microsoft.....
How is your job ??? I mean Your MARKETTING job ????? Do you need me to help you with that ?
cvogt61457
October 17th, 2003, 02:24 PM
For the hardware read/write, it's a function of the storage
medium, not the OS - If you're asking about the disk read/write.
Now, if the question is about what the author means....
I'm not sure.
Reading/writing to an external device implies that bytes are
read sequentially (or whatever the buss size is to the device)
Mick
October 17th, 2003, 02:31 PM
Originally posted by hometown
I am reading about how to make a WINDOWS OS like Microsoft.....
Which book as I asked?
How is your job ??? I mean Your MARKETTING job ????? Do you need me to help you with that ?
Well we are really on topic here, can't stay focused on your own rulez??? btw yes can you help me beat a dead horse???
hometown
October 17th, 2003, 02:37 PM
I am sorry I wasnot clear, my book says in Uniks, files will be copied byte by byte and in Windows they are done block by block and I really dont know how the writer can know that...which is why I made that questions...
May I ask another question ?
I would like to know if it is possible to write program to check out the bytes coppied from one file to another ? Look like the a download window poping up when we are downloading something ??
Is it difficult to write something like that ????
thanks a lot
cvogt61457
October 17th, 2003, 02:40 PM
Sounds like a file compare program.
hometown
October 17th, 2003, 02:40 PM
Originally posted by Mick
Which book as I asked?
oh well, book about canniballism...
hometown
October 17th, 2003, 02:44 PM
Originally posted by cvogt61457
Sounds like a file compare program.
What is that ?
Thanks,
cvogt61457
October 17th, 2003, 02:49 PM
I would like to know if it is possible to write program to check out the bytes coppied from one file to another ? Look like the a download window poping up when we are downloading something ??
Is it difficult to write something like that ????
The program you are wanting to check out the bytes copied.
hometown
October 17th, 2003, 02:58 PM
Originally posted by cvogt61457
The program you are wanting to check out the bytes copied.
thanks, :)
MrViggy
October 17th, 2003, 04:38 PM
Originally posted by hometown
I am sorry I wasnot clear, my book says in Uniks, files will be copied byte by byte and in Windows they are done block by block and I really dont know how the writer can know that...which is why I made that questions...
This prolly has something to do with the fact that the Windows style filesystem (FAT/FAT32/NTFS) is a "block based" system. In other words, Windows only saves things to disk in "blocks", and UNIX filesystems do not (I don't think). In other words, if I have a disk formatted to FAT, with a 32K blocksize, a 1 byte file would actually take up 32K on the disk. There's a lot of wasted space there...
Oh, and copy is *not* the same between UNIX and Windows. Windows makes an exact copy of the file, *including* the timestamp. UNIX will make a copy of the file, then 'touch' it.
Viggy
cvogt61457
October 17th, 2003, 04:46 PM
If you want to compare two files, you can use WinDiff program that
comes with the MSDEV.
Or, if you want to use this from a DOS style command line, use
"fc".
FC [/A] [/C] [/L] [/LBn] [/N] [/OFF[LINE]] [/T] [/U] [/W] [/nnnn]
[drive1:][path1]filename1 [drive2:][path2]filename2
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2
/A Displays only first and last lines for each set of differences.
/B Performs a binary comparison.
/C Disregards the case of letters.
/L Compares files as ASCII text.
/LBn Sets the maximum consecutive mismatches to the specified
number of lines.
/N Displays the line numbers on an ASCII comparison.
/OFF[LINE] Do not skip files with offline attribute set.
/T Does not expand tabs to spaces.
/U Compare files as UNICODE text files.
/W Compresses white space (tabs and spaces) for comparison.
/nnnn Specifies the number of consecutive lines that must match
after a mismatch.
[drive1:][path1]filename1
Specifies the first file or set of files to compare.
[drive2:][path2]filename2
Specifies the second file or set of files to compare.
hometown
October 17th, 2003, 05:03 PM
Thanks Viggy and cvogt61457 alot...
Well, I ve learnt alot of new things from you...
Thanks so much...
Fiona
khp
October 17th, 2003, 05:30 PM
Originally posted by MrViggy
UNIX filesystems do not (I don't think).
I'am prettys sure that almost all file systems are block based, the problem is that you would need a large address space to address, say a 100GB disk if every byte has to be individually addressable. For EXT2 (the most common linux filesystem) valid block sizes are 1024,2048 and 4096 bytes.
Originally posted by MrViggy
Oh, and copy is *not* the same between UNIX and Windows. Windows makes an exact copy of the file, *including* the timestamp. UNIX will make a copy of the file, then 'touch' it.
On the unix side that just depends what options you give cp.
MrViggy
October 17th, 2003, 06:08 PM
Right, right. Duh, that's because the disk itself is block based.
I think the answer is really in how is the "copy" command written. In Windows, the developers figured that since everything is in "block" format (i.e. each file on disk must fit inside a block, or a portion of a block), they could just copy the whole block.
But, please correct me here, on Unix, can't you store two different files in a single block? Or am I wrong? I'm thinking back to the definition of "fragmentation" on Unix vs the definition on Windows. On Windows, a "fragmented" file is one whose blocks do not "line up", i.e. the file is scattered all over; whereas on Unix a "fragmented" file is one that occupies a portion of a block (i.e. the actual filesize does not line up with the block size).
Viggy
Gabriel Fleseriu
October 17th, 2003, 06:51 PM
A couple of remarks, in no particular order:
1. That operating systems family is called unix, not 'uniks'
2. Digital identical copies are 'bit-by-bit', and not necessarily byte-by-byte. There are machines with bytes that don't have 8 bits.
3. No real operating system copies information from/to a mechanical storage device, like a disk, byte-by-byte, but always blockwise. Or else it took forever.
4. Windows and Unix are not the same thing.
5. One person is not able to write an OS like Windows, Unix or Linux alone. People simple don't live long enough.
6. A files timestamp is not stored in the file (both in Windows and *NIX). IOW, you have to differentiate between the contents of the file and its other attributes.
khp
October 17th, 2003, 07:11 PM
Originally posted by MrViggy
But, please correct me here, on Unix, can't you store two different files in a single block? Or am I wrong?
I think that depends on the filesystem used, this document (http://www.informatik.uni-frankfurt.de/~loizides/reiserfs/index.html#definition) briefly mentions FFS and ReiserFS sharing a single block between files. But doing a few simple test on an ext2 system I can't see this, I always loose at least one block every time I create a nonempty file, no matter how small.
Originally posted by MrViggy
I'm thinking back to the definition of "fragmentation" on Unix vs the definition on Windows. On Windows, a "fragmented" file is one whose blocks do not "line up", i.e. the file is scattered all over; whereas on Unix a "fragmented" file is one that occupies a portion of a block (i.e. the actual filesize does not line up with the block size).
The above linked documents speaks of this as internal and external fragmentation. Of course just about any file system will have both.
hometown
October 17th, 2003, 07:14 PM
Originally posted by Gabriel Fleseriu
A couple of remarks, in no particular order:
1. That operating systems family is called unix, not 'uniks'
I thought both are pronounced in the same way...:)
2. Digital identical copies are 'bit-by-bit', and not necessarily byte-by-byte. There are machines with bytes that don't have 8 bits.
What machine is that ?
5. One person is not able to write an OS like Windows, Unix or Linux alone. People simple don't live long enough.
[off topic] Are you laughing when typing these words down ? :)
Thanks alot for your answer...
Fiona
Mick
October 17th, 2003, 07:19 PM
Originally posted by Gabriel Fleseriu
A couple of remarks, in no particular order:
1. That operating systems family is called unix, not 'uniks'
it's not unix, it's not uniks, it's not *nix, it's UN*X ...get it right will you???