Groups
Activity
Members
C code Filesystem
[c] Code Segment
const struct vm_operations_struct generic_file_vm_ops = {
.fault = filemap_fault,
+ .page_mkwrite = filemap_page_mkwrite,
};
Code Dissection
1.const --- A C language keyword. Makes variable value or pointer parameter unmodifiable. 2.struct --- A C language keyword Groups variables into a single record. 3.vm_operations_struct --- A structure name. 4.generic_file_vm_ops --- A structure variable. 5. .fault and .page_mkwrite --- designated names. source :http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
Theory Drop
Structures in C are defined as data containers consisting of a sequence of named members of various types. They are similar to records in other programming languages. The members of a structure are stored in consecutive locations in memory, although the compiler is allowed to insert padding between or after members (but not before the first member) for efficiency. The size of a structure is equal to the sum of the sizes of its members, plus the size of the padding. source : http://en.wikipedia.org/wiki/C_syntax#Structures_and_unions
CONNECTION
The code segment contains "struct" keyword.
ls ( -B option ) ( not complete )
UNIX Command
$ls a1.txt a2.txt $ls . ./ ../ $cp a1.txt a1.txt~ $ls a1.txt a1.txt~ a2.txt $ls -B a1.txt a2.txt $l bash: l: command not found $ls a1.txt a1.txt~ a2.txt $ls --backup ls: unrecognized option '--backup' Try `ls --help' for more information. $ls --ignore-backups a1.txt a2.txt $
ls ( -a and -A options)
UNIX Command
$ls -a . .. a1.txt a2.txt $ls -A a1.txt a2.txt $ls a1.txt a2.txt $
UNIX Explanation
-a, --all
do not ignore entries starting with .
-A, --almost-all
do not list implied . and ..
computer science related Theory Drop
In computing, a hidden directory or hidden file is a directory (folder) or file which file system utilities do not display by default. They are commonly used for storing user preferences or preserving the state of a utility and are frequently created implicitly by using various utilities. Usually the intent is to not "clutter" the display of the contents of a directory with files the user did not create. source :http://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory
CONNECTION
current directory indicated by . and previous directory indicated by .. are both hidden
code
I am foo.
ls ( –author -l option)
UNIX Command
$ls --author -l total 4 -rw-r--r-- 1 jeffrin jeffrin jeffrin 0 Feb 19 22:30 a1.txt -rw-r--r-- 1 jeffrin jeffrin jeffrin 2 Feb 19 22:31 a2.txt $ls -l total 4 -rw-r--r-- 1 jeffrin jeffrin 0 Feb 19 22:30 a1.txt -rw-r--r-- 1 jeffrin jeffrin 2 Feb 19 22:31 a2.txt $
UNIX Explanation
--author
with -l, print the author of each file
computer science Theory Drop
The AND gate is a basic digital logic gate that implements logical conjunction - it behaves according to the truth table to the right. A HIGH output (1) results only if both the inputs to the AND gate are HIGH (1). If neither or only one input to the AND gate is HIGH, a LOW output results. In another sense, the function of AND effectively finds the minimum between two binary digits, just as the OR function finds the maximum. Therefore, the output is always 0 except when all the inputs are 1s. source :http://en.wikipedia.org/wiki/AND_gate
CONNECTION
Intended result is only obtained if
both -l and –author options are given(true).
ls ( –full-time option )
UNIX Command
$ls --full-time total 4 -rw-r--r-- 1 jeffrin jeffrin 0 2012-02-19 22:30:38.000000000 +0530 a1.txt -rw-r--r-- 1 jeffrin jeffrin 2 2012-02-19 22:31:00.000000000 +0530 a2.txt $date Sat Feb 25 01:17:27 IST 2012 $date -R Sat, 25 Feb 2012 01:19:41 +0530 $
UNIX Explanation
--full-time
like -l --time-style=full-iso
computer science related Theory Drop
In computer science and computer programming, system time
represents a computer system's notion of the passing of time. In
this sense, time also includes the passing of days on the calendar.
System time is measured by a system clock, which is typically
implemented as a simple count of the number of ticks that have
transpired since some arbitrary starting date, called the epoch.
For example, Unix and POSIX-compliant systems encode system time
("Unix time") as the number of seconds elapsed since the start of
the Unix epoch at 1 January 1970 00:00:00 UT, with exceptions for
leap seconds.
source : http://en.wikipedia.org/wiki/System_time