What do “piece”, “block”, “offset”, “buffer” and “sector” mean?

I saw some scripts that either deal with the archive, or with binary data, or with copies (without using the default functions for python). Use a piece, block or offset, buffer or sector.

I created a Python application and some of the requirements were met by external libraries (data archiving / extraction) or binaries. I would like to dive deeper now to use the functions of third-party libraries in my application by writing my own module. Now I would like to know what these terms mean and where I can start. Is there any documentation for the subject above?

Any documentation related to these words in the Python programming language will also be appreciated.

+7
python block chunks buffer
source share
1 answer

Chunk is used for any (usually quite large) amount of data that is still only part of any size of the whole, for example. The first 1000 bytes of the file. The next 3000 bytes may be the next fragment.

A block is used for a fixed amount of data (usually technically determined), which is usually only part of the whole, e. The first 1024 bytes of the file. The next block will also be 1024 bytes long. In addition, sometimes the entire block is not used; the second and last file block of 1034 bytes in size still has 1024 bytes, but only 10 bytes will be used.

An offset is a positional distance, usually between the start of something and a position of interest; E. d. if the 23rd byte in the meteorological data file stores the temperature, then the temperature offset is 23 bytes. It can also be a data position offset, e. d. if something went wrong, and now the file is damaged, this may be due to the fact that all bytes are shifted by 32 bytes to the back (after inserting 32 zeros at the beginning or the like), then the whole file has an offset of 32 bytes .

A buffer is the part of memory in which things are collected to process them as a whole when the buffer is full (or nearly full). A typical example is buffered output; here single characters are buffered until the end of the line, and then the entire line is printed to the terminal in a single write operation. Sometimes buffers have a fixed size, sometimes they have only an upper limit.

A sector is similar to a block, part of a fixed size of the whole, but is even more associated with technical origin. In general, part of the hardware (such as a hard disk or a CD) is often used in this case, and usually sectors contain blocks.

+14
source share

All Articles