how unix kernel distinguishes between a normal file and
device file ?
Answers were Sorted based on User's Feedback
Answer / asif
This information (file type) is stored in the inode of a
file, as one of the fields.
Is This Answer Correct ? | 26 Yes | 2 No |
Answer / manasi mishra
for normal file in the ls -l listing there is a '-' as
first character like '-rw-r--r- '.
-rw-r--r-- 1 batch sybase 0 Dec 4 14:50 test1
This identifies it as normal file.
But for device files , they are saved as character or else
blocks . So the first letter is 'c' for character , and 'b'
for blocks.
Is This Answer Correct ? | 20 Yes | 0 No |
Answer / asif
Guest,
You are right about the 'ls' command, but 'ls' is a user
level command, which invokes (among others) read system
call to read and display directory contents (file/ dir
names in a directory). Ultimately kernel parses inode of
each file to get its type.
Rgds,
asif
Is This Answer Correct ? | 7 Yes | 1 No |
Answer / komall ambastha
Device files are referenced by a major number, which
identifies the device type, and a minor type, which
identifies the unit, or instance of that major type.
Kernel distinguish between an ordinary file and
device/special file with Major number
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sougat
nornal are basically divided into two part text(printable)
or binary (printable ornonprintable character covering
entire ascii range)
where device file contain (stream of un interpretable
character)they have some attributes stored some where else
for the device to read and excute accordingly
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / guest
while listing the file names by ls-l command we get hyphen
is the first character that shows it is a normal file and
if we d instead of hyphen(-) that is device file
Is This Answer Correct ? | 6 Yes | 54 No |
What does sed command do in unix?
What is .sh file?
if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command use in unix? plz send this question.
Can you write a command to erase all files in the current directory including all its sub-directories?
What happens when we execute a unix command?
Why we are using UNIX OS when we are doing the testing in our application?
what is difference between unix and linux?
What is sed awk grep?
in a growing log file how will you see the 1st 99 lines?
How do you stop a running process?
their is a file1,file2 and i want to append file1 data to file2?
What are the unix commands?