Sponsored Content
Top Forums UNIX for Dummies Questions & Answers trying to understand rationale of unix stream i/o concept Post 302334764 by Perderabo on Thursday 16th of July 2009 11:23:54 AM
Old 07-16-2009
A method is like a subroutine. An example might be a file of dictionary words. Instead of writing. you "insert" the word. Somehow the system keeps the words in alphabetical order. You can retrieve a list of all word in alphabetical order or you can search for a word. But the data file itself is a black box and you can't access it. If you put 1,234 bytes worth of words into the data file it will be bigger than 1,234 bytes. The system needs some extra stuff to find it's way around the file. This extra stuff is the control blocks.

And believe it or not, there used to be a sequential file which behaved like a really stupid tape drive. You could read it. You could even read it byte-by-byte. But after you read, say, byte number 123, you had two choices: read byte 124 or close the file. However, the OS could predict a program's behavior rather easily and this was fast (for it's day).

There might be a "random" file where you could seek and then read, but it was slow. After seeking to byte 123 and reading one byte, you could next seek to byte 124 and read that. But if you wanted a sequential file, you were supposed use a sequential file, not a random file.

Mind you, a single data file might be opened as "sequential" by one program and "random" by another. But then each program had a different interface (or subroutine or method) to read the file. However there was no way to execute a data file or to read a program file.

There were many file types and OS's competed by offering more file types. The Unix model of just one file type displaced all of this.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Having difficulty with UNIX concept. Please help!

Hi, I would be very happy if someone could help me please. I am relatively new to UNIX, and still learning. My understanding of things are: Say I have a PC running Windows. This machine has a name. If I have 10 PC's, then I have 10 names, one for each PC. Each PC is independent of the other.... (4 Replies)
Discussion started by: ALon
4 Replies

2. UNIX for Advanced & Expert Users

don't understand the unix script

if {"$my_ext_type" = MAIN]; then cd $v_sc_dir Filex.SH $v_so_dir\/$v_fr_file Can somebody tell me what does this suggest. I am pretty new to unix and I am getting confused. What i understood from here is If we have a file extension name as MAIN which we have then we change the directory to... (1 Reply)
Discussion started by: pochaman
1 Replies

3. Shell Programming and Scripting

[Video stream] network stream recording with mplayer

Hi I used this command: mplayer http://host/axis-cgi/mjpg/video.cgi -user root -passwd root \ -cache 1024 -fps 25.0 -nosound -vc ffh264 \ -demuxer 3 -dumpstream -dumpfile output.avi It's ok but... Video Playing is very fast! Why? Is it a synch problem? What parameter I have to use for... (1 Reply)
Discussion started by: takeo.kikuta
1 Replies

4. Shell Programming and Scripting

Regarding Mail concept in unix

Hi, I am new to this mail concept in unix. i have requirement to read the mail from mailbox. Now to get the mail where i have to configure the mail id and also the mail server. Kindly suggest me. Thanks in advance. (3 Replies)
Discussion started by: krishna_gnv
3 Replies

5. Shell Programming and Scripting

Understand a old unix shell script

Hi All, I have a unix old script i but i am not able to understand the few commands in it and what it does. below is the script. if ; then for F in $(find $DIR/. ! -name . -prune -name "DP_*.dat") do IN=${F##/*/} OUT='ORD'$(echo $IN | cut -c7-) exec.ksh $IN... (2 Replies)
Discussion started by: kam786sim
2 Replies

6. UNIX for Dummies Questions & Answers

Plan9 sed - rationale for limitations

Using the 9base port in {Net,Free}BSD, it appears that Plan 9's sed 1. restricts the max number of sed commands and thereby the length of sed scripts 2. does not recognise the \nn flag where nn is the number of a matched substring. See example below. Questions: 1. Why would they limit... (1 Reply)
Discussion started by: uiop44
1 Replies

7. What is on Your Mind?

What exactly is the concept of BITS in this unix.com forum?

Is there a detailed page on the explanation of concept behind BITS and score used in this forum. Just saw the index on my Banking page. (Clicked the Banking hyperlink below my profile name on the topmost right corner of this screen) Thanks in advance. (2 Replies)
Discussion started by: Manjunath B
2 Replies

8. Shell Programming and Scripting

Stream manipulation in UNIX shell scripting

i have a file something like this : start: 01:00:00 01:30:00 02:30:00 05:30:00 end: 01:13:00 02:00:00 02:40:00 05:45:00 and i want (end - start) total run time in below format: run: 00:13:00 00:30:00 00:10:00 00:15:00 (4 Replies)
Discussion started by: Acme
4 Replies

9. Red Hat

How to Understand the UNIX Time Format?

How to understand the unix time format as here i have pasted this is a unix time 1402565420 and its 3:00 PM here but its give this Output as long number How can i make it to understand format as i have 3:00 PM Normal time format <----3:00PM = 1402565420----> Unix Time Will Any one Explain to... (4 Replies)
Discussion started by: babinlonston
4 Replies
TIFFReadScanline(3TIFF) 												   TIFFReadScanline(3TIFF)

NAME
TIFFReadScanline - read and decode a scanline of data from an open TIFF file SYNOPSIS
#include <tiffio.h> int TIFFReadScanline(TIFF *tif, tdata_t buf, uint32 row, tsample_t sample) DESCRIPTION
Read the data for the specified row into the (user supplied) data buffer buf. The data are returned decompressed and, in the native byte- and bit-ordering, but are otherwise packed (see further below). The buffer must be large enough to hold an entire scanline of data. Appli- cations should call the routine TIFFScanlineSize to find out the size (in bytes) of a scanline buffer. The row parameter is always used by TIFFReadScanline; the sample parameter is used only if data are organized in separate planes (PlanarConfiguration=2). NOTES
The library attempts to hide bit- and byte-ordering differences between the image and the native machine by converting data to the native machine order. Bit reversal is done if the FillOrder tag is opposite to the native machine bit order. 16- and 32-bit samples are automati- cally byte-swapped if the file was written with a byte order opposite to the native machine byte order, In C++ the sample parameter defaults to 0. RETURN VALUES
TIFFReadScanline returns -1 if it detects an error; otherwise 1 is returned. DIAGNOSTICS
All error messages are directed to the TIFFError(3TIFF) routine. Compression algorithm does not support random access. Data was requested in a non-sequential order from a file that uses a compression algorithm and that has RowsPerStrip greater than one. That is, data in the image is stored in a compressed form, and with multiple rows packed into a strip. In this case, the library does not support random access to the data. The data should either be accessed sequentially, or the file should be converted so that each strip is made up of one row of data. BUGS
Reading subsampled YCbCR data does not work correctly because, for PlanarConfiguration=2 the size of a scanline is not calculated on a per- sample basis, and for PlanarConfiguration=1 the library does not unpack the block-interleaved samples; use the strip- and tile-based inter- faces to read these formats. SEE ALSO
TIFFOpen(3TIFF), TIFFReadEncodedStrip(3TIFF), TIFFReadRawStrip(3TIFF), libtiff(3TIFF) Libtiff library home page: http://www.remotesensing.org/libtiff/ libtiff October 15, 1995 TIFFReadScanline(3TIFF)
All times are GMT -4. The time now is 02:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy