The document describes various file manipulation functions in Unix/Linux systems. It lists functions like open, read, write, close, lseek, link, unlink, stat, fstat that allow processes to access and manage files and file metadata. It provides details on the purpose of each function, their prototypes and parameters. It also explains system calls related to file permissions, ownership and timestamps like chmod, chown, utime.
Cloud architectures can be thought of in layers, with each layer providing services to the next. There are three main layers: virtualization of resources, services layer, and server management processes. Virtualization abstracts hardware and provides flexibility. The services layer provides OS and application services. Management processes support service delivery through image management, deployment, scheduling, reporting, etc. When providing compute and storage services, considerations include hardware selection, virtualization, failover/redundancy, and reporting. Network services require capacity planning, redundancy, and reporting.
NETCONF and YANG provide an improved way to manage IoT systems compared to SNMP. NETCONF allows retrieving and manipulating state and configuration data using XML over SSH. YANG defines data models for the configuration and state information. To manage an IoT device, a YANG model is defined, the device is configured to support NETCONF, and a manager can then send NETCONF commands to retrieve data and configure the device.
Computers are connected in a network to exchange information or resources with each other. Two or more computer are connected through network media called computer media.
There are a number of network devices or media that are involved to form computer network.
Computer loaded with Linux Operation System can also be a part of network whether it is a small or large network by multitasking and multi user natures.
Maintaining of system and network up and running is a task of System / Network Administrator’s job. In this article we are going to review frequently used network configuration and troubleshoot commands in Linux.
This document describes the functions of various Linux commands, including commands for listing files (ls), creating directories (mkdir) and files (touch, cat), copying files (cp), changing directories (cd), moving files (mv), finding file locations (whereis, which), displaying manual pages (man, info), checking disk usage (df, du), viewing running processes (ps), setting aliases (alias), changing user identity (su, sudo), viewing command history (history), setting the system date and time (date), displaying calendars (cal), and clearing the terminal screen (clear). It provides the syntax and examples for using each command.
UI controls in Android provide a variety of interactive components that can be used to build app interfaces, including buttons, text fields, progress bars, checkboxes, and more. TextViews display text and allow editing. Progress bars indicate task completion. TimePickers and DatePickers allow selecting times and dates. Intents describe operations and can launch activities, like calling a web browser to view a webpage from an app. Intent objects contain action and data components to specify the operation.
The document describes a three-tier architecture for mobile computing. It consists of a presentation tier, application tier, and data tier. The presentation tier handles the user interface and rendering. The application tier controls transaction processing and accommodates many users. The data tier manages database access and storage. Middleware sits between operating systems and user applications to handle functions like network management and security across tiers. This three-tier architecture provides benefits like improved performance, flexibility, maintainability and scalability.
Android Intents allow communication between app components and sharing of data. An Intent specifies an action and can contain data and extras. There are explicit intents, which target a specific component, and implicit intents, which specify an action that may be handled by multiple apps. Components declare intent filters in the manifest to receive implicit intents matching the filter's action, data, and category. When an implicit intent is received, the system resolves matching components by comparing the intent to intent filters.
The document discusses various built-in exceptions in Java including ArithmeticException, NullPointerException, and ArrayIndexOutOfBoundsException. It provides examples of code that triggers each exception and the corresponding output. It also discusses nested try/catch blocks to handle multiple exception types.
Cloud architectures can be thought of in layers, with each layer providing services to the next. There are three main layers: virtualization of resources, services layer, and server management processes. Virtualization abstracts hardware and provides flexibility. The services layer provides OS and application services. Management processes support service delivery through image management, deployment, scheduling, reporting, etc. When providing compute and storage services, considerations include hardware selection, virtualization, failover/redundancy, and reporting. Network services require capacity planning, redundancy, and reporting.
NETCONF and YANG provide an improved way to manage IoT systems compared to SNMP. NETCONF allows retrieving and manipulating state and configuration data using XML over SSH. YANG defines data models for the configuration and state information. To manage an IoT device, a YANG model is defined, the device is configured to support NETCONF, and a manager can then send NETCONF commands to retrieve data and configure the device.
Computers are connected in a network to exchange information or resources with each other. Two or more computer are connected through network media called computer media.
There are a number of network devices or media that are involved to form computer network.
Computer loaded with Linux Operation System can also be a part of network whether it is a small or large network by multitasking and multi user natures.
Maintaining of system and network up and running is a task of System / Network Administrator’s job. In this article we are going to review frequently used network configuration and troubleshoot commands in Linux.
This document describes the functions of various Linux commands, including commands for listing files (ls), creating directories (mkdir) and files (touch, cat), copying files (cp), changing directories (cd), moving files (mv), finding file locations (whereis, which), displaying manual pages (man, info), checking disk usage (df, du), viewing running processes (ps), setting aliases (alias), changing user identity (su, sudo), viewing command history (history), setting the system date and time (date), displaying calendars (cal), and clearing the terminal screen (clear). It provides the syntax and examples for using each command.
UI controls in Android provide a variety of interactive components that can be used to build app interfaces, including buttons, text fields, progress bars, checkboxes, and more. TextViews display text and allow editing. Progress bars indicate task completion. TimePickers and DatePickers allow selecting times and dates. Intents describe operations and can launch activities, like calling a web browser to view a webpage from an app. Intent objects contain action and data components to specify the operation.
The document describes a three-tier architecture for mobile computing. It consists of a presentation tier, application tier, and data tier. The presentation tier handles the user interface and rendering. The application tier controls transaction processing and accommodates many users. The data tier manages database access and storage. Middleware sits between operating systems and user applications to handle functions like network management and security across tiers. This three-tier architecture provides benefits like improved performance, flexibility, maintainability and scalability.
Android Intents allow communication between app components and sharing of data. An Intent specifies an action and can contain data and extras. There are explicit intents, which target a specific component, and implicit intents, which specify an action that may be handled by multiple apps. Components declare intent filters in the manifest to receive implicit intents matching the filter's action, data, and category. When an implicit intent is received, the system resolves matching components by comparing the intent to intent filters.
The document discusses various built-in exceptions in Java including ArithmeticException, NullPointerException, and ArrayIndexOutOfBoundsException. It provides examples of code that triggers each exception and the corresponding output. It also discusses nested try/catch blocks to handle multiple exception types.
Virtualization vulnerabilities, security issues, and solutions:
Virtualization is technological revolution that
separates functions from underlying hardware and allows
us to create useful environment from abstract resources.
Virtualization technology has been targeted by attackers
for malicious activity. Attackers could compromise VM
infrastructures, allowing them to access other VMs on the
same system and even the host.
This presentation emphasize on
the assessment of virtualization specific vulnerabilities,
security issues and possible solutions.
By-Nitish Awasthi
B.Tech.CTIS
Invertis University Bareilly
This document provides an overview of distributed operating systems, including:
- A distributed operating system runs applications on multiple connected computers that look like a single centralized system to users. It distributes jobs across processors for efficient processing.
- Early research began in the 1950s with systems like DYSEAC and Lincoln TX-2 that exhibited distributed control features. Major development occurred from the 1970s-1990s, though few systems achieved commercial success.
- Key considerations in designing distributed operating systems include transparency, inter-process communication, process management, resource management, reliability, and performance. Examples of distributed operating systems include Windows Server and Linux-based systems.
This document provides an overview of Java servlets technology, including:
1. What Java servlets are and their main purposes and advantages such as portability, power, and integration with server APIs.
2. Key aspects of servlet architecture like the servlet lifecycle, the HttpServletRequest and HttpServletResponse objects, and how different HTTP methods map to servlet methods.
3. Examples of simple servlets that process parameters, maintain a session counter, and examples of deploying servlets in Eclipse IDE.
This document discusses classes, objects, and methods in Java. It defines a class as a user-defined data type that contains fields and methods. Objects are instances of classes that allocate memory at runtime. Methods define behaviors for objects and are declared within classes. The document covers defining classes, creating objects, accessing members, constructors, method overloading and overriding, static members, passing objects as parameters, recursion, and visibility control.
This document summarizes a seminar on using applets in Java. It discusses preparing to write applets, developing and testing applets, the general format and lifecycle of applet code, and provides a sample code for a kite drawing applet. The sample code imports graphics libraries, defines x and y coordinate arrays, and uses the drawPolygon method to output a kite shape when the applet is run.
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSINGAaqib Hussain
This document provides an introduction to Java Server Pages (JSP) including the JSP life cycle and anatomy of a JSP page. It discusses how JSP pages allow embedding Java code in HTML elements to generate dynamic web content. When a request is made to a JSP page, it is processed by a JSP container that converts the page into a Java servlet, compiles the servlet, and executes the servlet to handle the request and generate the response. The document also describes how JSP pages combine static template text and dynamic JSP elements and the translation and request processing phases of handling JSP requests.
An operating system acts as an interface between the user and computer hardware, controlling program execution and performing basic tasks like file management, memory management, and input/output control. There are four main types of operating systems: monolithic, layered, microkernel, and networked/distributed. A monolithic OS has all components in the kernel, while layered and microkernel OSes separate components into different privilege levels or layers for modularity. Networked/distributed OSes enable accessing resources across multiple connected computers.
This document provides instructions for experiments in a Database Management System laboratory course. It includes a list of 12 experiments covering topics like Data Definition Language commands, Data Manipulation Language commands, database design using ER modeling and normalization, and implementation of various database applications. It also provides details on the hardware and software requirements for the course, as well as the internal assessment structure including marks distribution.
Group Policy Objects (GPOs) can be used to centrally manage user and computer settings across a Windows network. GPOs are created and linked to sites, domains, and organizational units to apply policies to all computers and users within those containers. Common uses of GPOs include controlling user desktop settings and security, deploying login and startup scripts, redirecting user folders, and installing or removing software applications. Troubleshooting tools like GPRESULT and Resultant Set of Policy can help determine which policies are in effect for a given user or computer.
The document discusses the different building blocks of an Android application including activities, services, broadcast receivers, and content providers. It provides details on broadcast receivers, describing them as components that respond to system-wide broadcasts and application-initiated broadcasts. The document gives an example of using a broadcast receiver to capture the SMS receive event and launch an activity to display the SMS with an option to reply. It also discusses programmatically sending SMS from an application.
The document provides information about shells in Linux operating systems. It defines what a kernel and shell are, explains why shells are used, describes different types of shells, and provides examples of shell scripting. The key points are:
- The kernel manages system resources and acts as an intermediary between hardware and software. A shell is a program that takes commands and runs them, providing an interface between the user and operating system.
- Shells are useful for automating tasks, combining commands to create new ones, and adding functionality to the operating system. Common shells include Bash, Bourne, C, Korn, and Tcsh.
- Shell scripts allow storing commands in files to automate tasks.
This document discusses threads and multithreaded programming. It covers thread libraries like Pthreads, Windows threads and Java threads. It also discusses implicit threading using thread pools, OpenMP and Grand Central Dispatch. Issues with multithreaded programming like signal handling, thread cancellation and thread-local storage are examined. Finally, thread implementation in Windows and Linux is overviewed.
The document discusses various Java I/O streams including input streams, output streams, byte streams, character streams, buffered streams, properties class, print stream, file locking, serialization and print writer class. It provides examples of reading and writing files using FileInputStream, FileOutputStream, FileReader, FileWriter and other stream classes. Methods of different stream classes are also explained along with their usage.
Android uses Views and ViewGroups to create user interfaces. Views occupy rectangular areas on screen and handle drawing and events. Common widgets like Buttons and TextViews are subclasses of View. Layouts like LinearLayout and RelativeLayout are ViewGroups that position child Views. Layout parameters specify how Views are positioned. Common event listeners include onClick and onTouch, which call registered event handlers when triggered by user interaction.
Network programming in java - PPT with Easy Programs and examples of Java InetAddress Class and java socket programming example.
Learn more @ http://java2all.com/technology/network-programming
The document describes the different types of files in Unix/Linux systems. It discusses regular files, directories, FIFO files, character device files, and block device files. It also outlines some of the key attributes of files like permissions, owners, sizes, and times. The document explains how files are uniquely identified by their inode number and file system ID in the Unix file system.
The document discusses UNIX file APIs. It describes how UNIX applications interface with files by creating, opening, reading, writing, closing, removing, and querying files. It covers APIs like open(), read(), write(), close(), unlink(), stat(), and others. It also describes different file types in UNIX like regular files, directories, FIFOs, devices, and symbolic links. The APIs to manage these different file types are also covered.
Virtualization vulnerabilities, security issues, and solutions:
Virtualization is technological revolution that
separates functions from underlying hardware and allows
us to create useful environment from abstract resources.
Virtualization technology has been targeted by attackers
for malicious activity. Attackers could compromise VM
infrastructures, allowing them to access other VMs on the
same system and even the host.
This presentation emphasize on
the assessment of virtualization specific vulnerabilities,
security issues and possible solutions.
By-Nitish Awasthi
B.Tech.CTIS
Invertis University Bareilly
This document provides an overview of distributed operating systems, including:
- A distributed operating system runs applications on multiple connected computers that look like a single centralized system to users. It distributes jobs across processors for efficient processing.
- Early research began in the 1950s with systems like DYSEAC and Lincoln TX-2 that exhibited distributed control features. Major development occurred from the 1970s-1990s, though few systems achieved commercial success.
- Key considerations in designing distributed operating systems include transparency, inter-process communication, process management, resource management, reliability, and performance. Examples of distributed operating systems include Windows Server and Linux-based systems.
This document provides an overview of Java servlets technology, including:
1. What Java servlets are and their main purposes and advantages such as portability, power, and integration with server APIs.
2. Key aspects of servlet architecture like the servlet lifecycle, the HttpServletRequest and HttpServletResponse objects, and how different HTTP methods map to servlet methods.
3. Examples of simple servlets that process parameters, maintain a session counter, and examples of deploying servlets in Eclipse IDE.
This document discusses classes, objects, and methods in Java. It defines a class as a user-defined data type that contains fields and methods. Objects are instances of classes that allocate memory at runtime. Methods define behaviors for objects and are declared within classes. The document covers defining classes, creating objects, accessing members, constructors, method overloading and overriding, static members, passing objects as parameters, recursion, and visibility control.
This document summarizes a seminar on using applets in Java. It discusses preparing to write applets, developing and testing applets, the general format and lifecycle of applet code, and provides a sample code for a kite drawing applet. The sample code imports graphics libraries, defines x and y coordinate arrays, and uses the drawPolygon method to output a kite shape when the applet is run.
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSINGAaqib Hussain
This document provides an introduction to Java Server Pages (JSP) including the JSP life cycle and anatomy of a JSP page. It discusses how JSP pages allow embedding Java code in HTML elements to generate dynamic web content. When a request is made to a JSP page, it is processed by a JSP container that converts the page into a Java servlet, compiles the servlet, and executes the servlet to handle the request and generate the response. The document also describes how JSP pages combine static template text and dynamic JSP elements and the translation and request processing phases of handling JSP requests.
An operating system acts as an interface between the user and computer hardware, controlling program execution and performing basic tasks like file management, memory management, and input/output control. There are four main types of operating systems: monolithic, layered, microkernel, and networked/distributed. A monolithic OS has all components in the kernel, while layered and microkernel OSes separate components into different privilege levels or layers for modularity. Networked/distributed OSes enable accessing resources across multiple connected computers.
This document provides instructions for experiments in a Database Management System laboratory course. It includes a list of 12 experiments covering topics like Data Definition Language commands, Data Manipulation Language commands, database design using ER modeling and normalization, and implementation of various database applications. It also provides details on the hardware and software requirements for the course, as well as the internal assessment structure including marks distribution.
Group Policy Objects (GPOs) can be used to centrally manage user and computer settings across a Windows network. GPOs are created and linked to sites, domains, and organizational units to apply policies to all computers and users within those containers. Common uses of GPOs include controlling user desktop settings and security, deploying login and startup scripts, redirecting user folders, and installing or removing software applications. Troubleshooting tools like GPRESULT and Resultant Set of Policy can help determine which policies are in effect for a given user or computer.
The document discusses the different building blocks of an Android application including activities, services, broadcast receivers, and content providers. It provides details on broadcast receivers, describing them as components that respond to system-wide broadcasts and application-initiated broadcasts. The document gives an example of using a broadcast receiver to capture the SMS receive event and launch an activity to display the SMS with an option to reply. It also discusses programmatically sending SMS from an application.
The document provides information about shells in Linux operating systems. It defines what a kernel and shell are, explains why shells are used, describes different types of shells, and provides examples of shell scripting. The key points are:
- The kernel manages system resources and acts as an intermediary between hardware and software. A shell is a program that takes commands and runs them, providing an interface between the user and operating system.
- Shells are useful for automating tasks, combining commands to create new ones, and adding functionality to the operating system. Common shells include Bash, Bourne, C, Korn, and Tcsh.
- Shell scripts allow storing commands in files to automate tasks.
This document discusses threads and multithreaded programming. It covers thread libraries like Pthreads, Windows threads and Java threads. It also discusses implicit threading using thread pools, OpenMP and Grand Central Dispatch. Issues with multithreaded programming like signal handling, thread cancellation and thread-local storage are examined. Finally, thread implementation in Windows and Linux is overviewed.
The document discusses various Java I/O streams including input streams, output streams, byte streams, character streams, buffered streams, properties class, print stream, file locking, serialization and print writer class. It provides examples of reading and writing files using FileInputStream, FileOutputStream, FileReader, FileWriter and other stream classes. Methods of different stream classes are also explained along with their usage.
Android uses Views and ViewGroups to create user interfaces. Views occupy rectangular areas on screen and handle drawing and events. Common widgets like Buttons and TextViews are subclasses of View. Layouts like LinearLayout and RelativeLayout are ViewGroups that position child Views. Layout parameters specify how Views are positioned. Common event listeners include onClick and onTouch, which call registered event handlers when triggered by user interaction.
Network programming in java - PPT with Easy Programs and examples of Java InetAddress Class and java socket programming example.
Learn more @ http://java2all.com/technology/network-programming
The document describes the different types of files in Unix/Linux systems. It discusses regular files, directories, FIFO files, character device files, and block device files. It also outlines some of the key attributes of files like permissions, owners, sizes, and times. The document explains how files are uniquely identified by their inode number and file system ID in the Unix file system.
The document discusses UNIX file APIs. It describes how UNIX applications interface with files by creating, opening, reading, writing, closing, removing, and querying files. It covers APIs like open(), read(), write(), close(), unlink(), stat(), and others. It also describes different file types in UNIX like regular files, directories, FIFOs, devices, and symbolic links. The APIs to manage these different file types are also covered.
The document summarizes various UNIX file APIs for opening, reading, writing, closing, and querying files. It describes functions like open(), read(), write(), close(), stat(), fstat(), lseek(), link(), unlink(), chmod(), and utime(). For each function, it provides the header files, function prototype, parameters, and purpose in 1-3 sentences.
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use of the system and may also include accounting software for cost allocation of processor time, mass storage, printing, and other resources.
For hardware functions such as input and output and memory allocation, the operating system acts as an intermediary between programs and the computer hardware,[1][2] although the application code is usually executed directly by the hardware and frequently makes system calls to an OS function or is interrupted by it. Operating systems are found on many devices that contain a computer – from cellular phones and video game consoles to web servers and supercomputers.
The dominant general-purpose[3] personal computer operating system is Microsoft Windows with a market share of around 76.45%. macOS by Apple Inc. is in second place (17.72%), and the varieties of Linux are collectively in third place (1.73%).[4] In the mobile sector (including smartphones and tablets), Android's share is up to 72% in the year 2020.[5] According to third quarter 2016 data, Android's share on smartphones is dominant with 87.5 percent with also a growth rate of 10.3 percent per year, followed by Apple's iOS with 12.1 percent with per year decrease in market share of 5.2 percent, while other operating systems amount to just 0.3 percent.[6] Linux distributions are dominant in the server and supercomputing sectors. Other specialized classes of operating systems (special-purpose operating systems),[3][7] such as embedded and real-time systems, exist for many applications. Security-focused operating systems also exist. Some operating systems have low system requirements (e.g. light-weight Linux distribution). Others may have higher system requirements.
This document discusses UNIX file APIs. It describes various file types and common file manipulation APIs such as open, creat, read, write, close, fcntl, lseek, link, unlink, stat, fstat, and access. It also covers file and record locking mechanisms in UNIX, which allow processes to synchronize access to shared files using mandatory or advisory locks. Finally, it provides an overview of UNIX processes, including the main function, process termination, command line arguments, and the environment list passed to programs.
The document contains questions and answers related to network programming and UNIX system concepts. Some key points covered include:
- File descriptors are integers used by the kernel to identify open files for a process. A program is executed as a process, which has a unique process ID.
- There are two types of CPU times in UNIX - user CPU time for user instructions, and system CPU time for when the kernel executes on behalf of the process.
- Common IPC methods in UNIX include pipes, message queues, semaphores and shared memory. Message queues store prioritized messages in a linked list.
SELinux (Security Enhanced Linux) is an internal firewall that confines processes and protects the operating system through mandatory access controls. It prevents processes from accessing files or resources without permission. SELinux enforces a security policy that defines what subjects (users and programs) can access which objects (files, devices, ports). It provides confinement for untrusted programs and limits the damage that can be caused by malicious software.
File Operation such as
Reading the file content
Writing the content to the file
Copying the content from one file to another file
Counting the number of character, words and lines of the file
This document provides an overview of different Linux I/O models including blocking I/O, non-blocking I/O, I/O multiplexing using select, poll, epoll, signal-driven I/O and asynchronous I/O. It describes key functions and system calls used for each model and provides examples of how they can be used in drivers and applications.
The document discusses Linux file systems and permissions. It describes the Virtual File System (VFS) interface and how it interacts with filesystems, inodes, and open files. It then discusses the EXT2 filesystem in more detail, including how inodes store file metadata and pointers to data blocks. It also covers how permissions and ownership are represented, and commands to view and modify permissions like chmod, chown, and umask. Finally, it briefly discusses hard and soft links, and sticky bits.
The document discusses Linux file systems and permissions. It describes the Virtual File System (VFS) interface and how it interacts with filesystems, inodes, and open files. It then discusses the EXT2 filesystem in more detail, describing how inodes store file metadata and how hard and soft links work. It also covers common Linux permissions and how to manage users, groups, and permissions using commands like chmod, chown, useradd, and others.
Basic of and Unix and Command. More presentation you can find on www.scmGalaxy.com.
scmGalaxy.com is dedicated to software configuration, build and Release management. This covers CVS, VSS (Visual Source Safe),Perforce, SVN(Subversion) MKS Integrity, ClearCase,TFS,CM Synergy, Best Practices ,AnthillPro, Apache Ant, Maven, Bamboo, Cruise Control and many more tools.
Linux Operating System. Unix_Lec-6.pptxHITENKHEMANI
This document discusses Unix shell programming and specifically focuses on redirection of standard input and output streams. It describes how the standard input, output, and error streams are represented by file descriptors 0, 1, and 2 respectively. It explains how to redirect standard input using <, standard output using >, and standard error using 2>. The document also covers changing file and directory permissions using the chmod command in both relative and absolute manners.
The document discusses Unix commands and processes. It describes:
1. There are two types of processes - foreground processes which are interactive and initiated by the user, and background processes which are non-interactive and initiated by the system or user.
2. External commands are located in directories like /bin or /usr/bin and require spawning a new process when executed.
3. The type command describes if a command is an alias, keyword, builtin, or external file. The man command displays manuals for commands, divided into sections.
4. The root login provides the highest access as the superuser. The su command allows switching to other users including root with proper privileges.
The document discusses Unix commands and processes. It describes:
1. There are two types of processes - foreground processes which are interactive and initiated by the user, and background processes which are non-interactive and initiated by the system or user.
2. External commands are located in directories like /bin or /usr/bin and require spawning a new process when executed.
3. The type command describes if a command is an alias, keyword, builtin, or external file. The man command displays manuals for commands, divided into sections.
4. The root login provides the highest access on a system. The su command allows switching to another user, like root, with root privileges.
The document discusses the components of a file system in a UNIX system including the boot block, super block, inode list, and data blocks. It describes the information stored in the super block and inodes. Inodes contain metadata about files such as ownership, permissions, size, and location of data blocks. The document also covers various file-related system calls like open, read, write, close, and lseek. It provides examples of using these calls to perform operations like opening, reading, writing to files and modifying the file offset. File locking mechanisms using flock struct and fcntl calls are also explained.
This document provides guidance for Linux administration practicals, including:
- An index of 17 practical topics ranging from basic Linux commands to configuring mail services.
- Detailed instructions for Practical 1 on basic commands like cat, mkdir, cp, and editors like vi. It provides an example directory and file structure to create.
- An overview of Practical 2 on installing Red Hat Linux, including selecting installation options and partitioning the hard drive to make space.
- Descriptions of changing file permissions using both binary and symbolic modes with chmod, and decoding permission codes from the ls command.
- An explanation of the different modes in the vi editor like command, insert, and ex modes,
2. Open Opens a file for data access
Read Reads data from file
Write Writes data into file
Lseek Allows random access of
data in a file
Close Terminates connection to a
file
Stat,fstat Queries attributes of a
file
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 2
3. Chmod Changes access
permissions of a file
Chown Changes UID and/or GID of a
file
Utime Changes last modification
time and access time
stamps of a file
Link creates a hard link to a file
Ulink Deletes a hard link to a file
Umask Sets default file creation
mask
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 3
4. The function establishes connection
between process and a file
The prototype of the function
#include <sys/types.h>
#include <fcntl.h>
int open (const char *pathname, int access
mode , mode_t permission);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 4
5. Pathname : It can be absolute path
name or a relative
path
name
Access_mode : An integer which
specifies how file is
to be
accessed by calling
process
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 5
6. Access mode flag Use
O_RDONLY Opens file for read-
only
O_WRONLY Opens file for write
only
O_RDWR Opens file for read
& write
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 6
8. O_APPEND : appends data to end of file
O_TRUNC : if the file already exists,
discards its contents
and
sets file size to zero
O_CREAT : creates the file if it does
not
exist
O_EXCL : used with O_CREAT only.
This flag causes open to
fail if the file exists
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 8
9. O_NONBLOCK : specifies that any
subsequent read or
write
on the file should be
non
blocking
O_NOCTTY : specifies not to use the
named terminal
device
file as the calling
process
control terminal
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 9
10. It specifies some access rights to be masked off
Prototype:
mode_t umask ( mode_t new_umask);
mode_t old_mask =
umask (S_IXGRP|S_IWOTH);
/*removes execute permission from others and write
permission from group*/
Actual_permission =
permission & ~umask_value
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 10
11. It is used to create new regular files
#include <sys/types.h>
#include <unistd.h>
Int creat (const char* pathname,mode_t mode)
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 11
12. This function fetches a fixed size block of data from
a file referenced by a given file descriptor
#include <sys/types.h>
#include <unistd.h>
ssize_t read (int fdesc ,void* buf, size_t size);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 12
13. The write function puts a fixed size block
of data to a file referenced by a file
descriptor
#include <sys/types.h>
#include <unistd.h>
ssize_t read (int fdesc ,void* buf, size_t size);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 13
14. Disconnects a file from a process
#include <unistd.h>
int close (int fdesc);
Close function will allocate system resources
It a process terminates without closing all the files
it has opened ,the kernel will close those files for
the process
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 14
15. The function helps user to query or set access
control flags and the close-on-exec flag of any file
descriptor
#include <fcntl.h>
Int fcntl (int fdesc ,int cmd,……);
cmd argument specifies which operation to
perform on a file referenced by the fdesc
argument
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 15
16. cmd value
F_GETFL : returns the access control fl ags of a
file descriptor fdesc
F_SETFL : sets or clears control flags that are
specified
F_GETFD : returns the close-on-exec flag of a file
referenced by fdesc
F_SETFD : sets or clears close-on-exec flag of a
file descriptor fdesc
F_DUPFD : duplicates the file descriptor fdesc
with another file descriptor
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 16
17. the lseek system call is used to change the file
offset to a different value
Prototype :
#include <sys/types.h>
#include <unistd.h>
Off_t sleek (int fdesc , off_t pos, int whence)
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 17
18. Pos :
specifies a byte offset to be added to a
reference location in deriving the new file
offset value
Whence location reference
SEEK_CUR current file
pointer
address
SEEK_SET the beginning of
a
file
SEEK_END the end of a file
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 18
19. The link function creates a new link for
existing file
Prototype :
#include <unistd.h>
int link (const char* cur_link ,const char*
new_link)
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 19
20. Deletes link of an existing file
#include <unistd.h>
int unlink (const char* cur_link );
Cannot link a directory unless the
calling function has the superuser
privilege
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 20
21. Stat and fstat retrieve arguments of a
given file
#include <sys/types.h>
#include <unistd.h>
int stat (const char* path_name,struct
stat* statv)
int fstat (const int fdesc,struct stat* statv)
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 21
23. If pathname specified in stast is a
symbolic link then the attributes of the
non-symbolic file is obtained
To avoid this lstat system call is used
It is used to obtain attribites of the
symbolic link file
int lstat (const char* path_name , struct stat*
statv);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 23
24. /* Program to emulate the UNIX ls -l
command */
#include <iostream.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <pwd.h>
#include <grp.h>
static char xtbl[10] = "rwxrwxrwx";
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 24
25. #ifndef MAJOR
#define MINOR_BITS 8
#define MAJOR(dev) ((unsigned)dev >>
MINOR_BITS)
#define MINOR(dev) ( dev &
MINOR_BITS)
#endif
/* Show file type at column 1 of an output
line */
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 25
26. static void display_file_type ( ostream&
ofs, int
st_mode )
{
switch (st_mode &S_IFMT)
{
case S_IFDIR: ofs << 'd';
return;
/*
directory file */
case S_IFCHR: ofs << 'c';
return;
/* character
device file */
case S_IFBLK: ofs << 'b'; return;
/* block
device file */
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 26
27. case S_IFREG: ofs << ' '; return;
/*
regular file */
case S_IFLNK: ofs << 'l'; return;
/* symbolic
link file */
case S_IFIFO: ofs << 'p'; return;
/*
FIFO file */
}
}
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 27
28. /* Show access permission for owner,
group, others, and any special flags */
static void display_access_perm
( ostream&
ofs, int
st_mode )
{
char amode[10];
for (int i=0, j= (1 << 8); i < 9; i++,
j>>=1)
amode[i] = (st_mode&j) ? xtbl[i] : '-';
/* set access permission
Sunil Kumar R.M Lecturer Dept of
*/ CSE RLJIT 28
29. /* set access permission */
if (st_mode&S_ISUID)
amode[2] = (amode[2]=='x') ? 'S' :
's';
if (st_mode&S_ISGID)
amode[5] = (amode[5]=='x') ? 'G' :
'g';
if (st_mode&S_ISVTX)
amode[8] = (amode[8]=='x') ? 'T' :
't';
ofs << amode << ' ';
}
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 29
30. /* List attributes of one file */
static void long_list (ostream& ofs, char*
path_name)
{
struct stat statv;
struct group *gr_p;
struct passwd *pw_p;
if (stat (path_name, &statv))
{
perror( path_name );
return;
}
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 30
31. display_file_type( ofs, statv.st_mode );
display_access_perm( ofs, statv.st_mode
);
ofs << statv.st_nlink;
/* display hard
link count */
gr_p = getgrgid(statv.st_gid);
/* convert GID to group name
*/
pw_p = getpwuid(statv.st_uid);
/*convert UID to user name */
ofs << ' ' << pw_p->pw_name << ' '
<<
gr_p->gr_name
<< ' '; Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 31
32. if ((statv.st_mode&S_IFMT) == S_IFCHR ||
(statv.st_mode&S_IFMT)==S_IFBLK)
ofs << MAJOR(statv.st_rdev) << ','
<< MINOR(statv.st_rdev);
else ofs << statv.st_size;
/* show file size or major/minor no. */
ofs << ' ' << ctime (&statv.st_mtime);
/* print last modification time */
ofs << ' ' << path_name << endl;
/* show file name */
}
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 32
33. /* Main loop to display file attributes one
file
at a
time */
int main (int argc, char* argv[])
{
if (argc==1)
cerr << "usage: " << argv[0] << " <file
path name> ...n";
else while (--argc >= 1) long_list( cout,
*+
+argv);
return 0;
}
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 33
34. The access function checks the existence
and/or access permission of user to a
named file
#include <unistd.h>
int access (const char* path_name, int flag);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 34
35. The flag contains one or more bit flags
Bit flags USE
F_OK checks whether the file exists
R_OK checks whether calling
process has read
permission
W_OK checks whether calling
process has write
permission
X_OK checks whether calling
process has read
permission
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 35
36. The chmod and fcmod functions change
file access permissions for owner, group
and others and also set-UID ,set-GID and
sticky bits
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int chmod (const char* path_name, mode_t flag);
int fchmod (int fdsec, mode_t flag);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 36
37. Flag argument contains new access
permissions and any special flags to be
set on the file
Flag value can be specified as an octal
integer value in UNIX, or constructed from
the manifested constants defined in
<sys/stat.h>
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 37
38. The chown and fchown function change
the user ID and group ID of files
lchown changes the ownership of symbolic
link file
#include <unistd.h>
#include <sys/types.h>
int chown (const char* path_name,
uid_t uid, gid_t gid);
int fchown (int fdesc, uid_t uid, gid_t gid);
int lchown (const char* path_name,
uid_t uid, gid_t gid);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 38
39. • The function modifies the access and
modification time stamps of a file
#include <unistd.h>
#include <sys/types.h>
#include <utime.h>
int utime (const char* path_name,
struct utimbuf* times);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 39
41. UNIX systems allow multiple processes to
read and write the same file concurrently.
It is a means of data sharing among
processes.
Why the need to lock files?
It is needed in some applications like
database access where no other process
can write or read a file while a process is
accessing a file-locking mechanism.
File locking is applicable only to regular
files
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 41
42. A read lock is also called a shared lock
and a write lock is called an exclusive
lock.
These locks can be imposed on the
whole file or a portion of it.
A write lock prevents other processes
from setting any overlapping read or
write locks on the locked regions of the
file. The intention is to prevent other
processes from both reading and writing
the locked region while a process is
modifying the region.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 42
43. A read lock allows processes to set
overlapping read locks but not write locks.
Other processes are allowed to lock and
read data from the locked regions.
A mandatory locks can cause problems: If
a runaway process sets a mandatory
exclusive lock on a file and never unlocks
it, no other processes can access the
locked region of the file until either a
runaway process is killed or the system is
rebooted.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 43
44. If a file lock is not mandatory it is
advisory. An advisory lock is not enforced
by a kernel at the system call level
The following procedure is to be followed
Try to set a lock at the region to be
accessed. if this fails, a process can
either wait for the lock request to become
successful or go do something else and
try to lock the file again.
After a lock is acquired successfully, read
or write the locked region
Release the lock
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 44
45. A process should always release any lock
that it imposes on a file as soon as it is
done.
An advisory lock is considered safe, as no
runaway processes can lock up any file
forcefully. It can read or write after a fixed
number of failed attempts to lock the file
Drawback: the programs which create
processes to share files must follow the
above locking procedure to be
cooperative.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 45
46. int fcntl (int fdesc, int cmd_flag, …);
Cmd_flag Use
F_SETLK Sets a file lock. Do not block if this
cannot succeed immediately.
F_SETLKW Sets a file lock and blocks the
calling process until the lock is
acquired.
F_GETLK Queries as to which process locked
a specified region of a file.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 46
47. For file locking the third argument is struct flock-
typed variable.
struct flock
{
short l_type;
short l_whence;
off_t l_start;
off_t l_len;
pid_t l_pid;
};
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 47
48. l_type value Use
F_RDLCK Sets as a read (shared)
lock
on a specified region
F_WRLCK Sets a write (exclusive)
lock
on a specified region
F_UNLCK Unlocks a specified
region
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 48
49. l_whence value Use
SEEK_CUR The l_start value
is
added to the
current file
pointer address
SEEK_SET The l_start value is
added to byte 0
of file
SEEK_END The l_start value is
added to the end
(current size) of
the file Sunil Kumar R.M
CSE
Lecturer Dept of
RLJIT 49
50. The l_len specifies the size of a locked
region beginning from the start address
defined by l_whence and l_start. If l_len is
0 then the length of the locked is imposed
on the maximum size and also as it
extends. It cannot have a –ve value.
When fcntl is called, the variable contains
the region of the file locked and the ID of
the process that owns the locked region.
This is returned via the l_pid field of the
variable.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 50
51. LOCK PROMOTION AND
SPLITTING
If a process sets a read lock and
then a write lock the read lock is
now covered by a write lock. This
process is called lock promotion.
If a process unlocks any region in
between the region where the lock
existed then that lock is split into
two locks over the two remaining
regions.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 51
52. Mandatory locks can be achieved by setting
the following attributes of a file.
Turn on the set-GID flag of the file.
Turn off the group execute right of the file.
All file locks set by a process will be
unlocked terminates.
If a process locks a file and then creates a
child process via fork, the child process
will not inherit the lock.
The return value of fcntl is 0 if it succeeds
or -1 if it fails.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 52
53. #include <iostream.h>
#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
int main (int argc, char* argv[])
{
struct flock fvar;
int fdesc;
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 53
54. while (--argc > 0) { /* do the
following for each file */
if ((fdesc=open(*++argv,O_RDWR))==-1)
{
perror("open"); continue;
}
fvar.l_type = F_WRLCK;
fvar.l_whence = SEEK_SET;
fvar.l_start = 0;
fvar.l_len = 0;
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 54
55. /* Attempt to set an exclusive (write) lock
on the entire file */
while (fcntl(fdesc, F_SETLK,&fvar)==-1)
{
/* Set lock fails, find out who has locked
the file */
while (fcntl(fdesc,F_GETLK,&fvar)!=-1 &&
fvar.l_type!=F_UNLCK)
{
cout << *argv << " locked by " <<
fvar.l_pid<< " from " << fvar.l_start
<< " for "<< fvar.l_len << " byte for " <<
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 55
56. (fvar.l_type==F_WRLCK ? 'w' :
'r') << endl;
if (!fvar.l_len) break;
fvar.l_start += fvar.l_len;
fvar.l_len = 0;
} /* while there are locks set by
other processes */
} /* while set lock un-successful */
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 56
57. // Lock the file OK. Now process data in
the file
/* Now unlock the entire file */
fvar.l_type = F_UNLCK;
fvar.l_whence = SEEK_SET;
fvar.l_start = 0;
fvar.l_len = 0;
if (fcntl(fdesc, F_SETLKW,&fvar)==-1)
perror("fcntl");
}
return 0;
} /* main */
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 57
58. Why do need directory files?
Uses?
To aid users in organizing their
files into some structure based
on the specific use of files
They are also used by the
operating system to convert file
path names to their inode
numbers
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 58
59. To create
int mkdir (const char* path_name , mode_t
mode);
The mode argument specifies the access
permission for the ownerv,group, and
others to be assigned to the file.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 59
60. Directory created by mknod API does not
contain the “.” and “..” links. These links
are accessible only after the user
explicitly creates them.
Directory created by mkdir has the “.” and
“..” links created in one atomic operation,
and it is ready to be used.
One can create directories via system
API’s as well.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 60
61. A newly created directory has its user ID
set to the effective user ID of the process
that creates it.
Directory group ID will be set to either the
effective group ID of the calling process
or the group ID of the parent directory that
hosts the new directory.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 61
62. Opendir:
DIR*opendir (const char*
path_name);
This opens the file for read-only
Readdir:
Dirent* readdir(DIR* dir_fdesc);
The dir_fdesc value is the DIR*
return
value from an opendir call.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 62
63. Closedir :
int closedir (DIR* dir_fdesc);
It terminates the connection between the
dir_fdesc handler and a directory file.
Rewinddir :
void rewinddir (DIR* dir_fdesc);
Used to reset the file pointer associated
with a dir_fdesc.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 63
64. Rmdir API:
int rmdir (const char* path_name);
Used to remove the directory files. Users
may also use the unlink API to remove
directories provided they have superuser
privileges.
These API’s require that the directories to
be removed be empty, in that they contain
no files other than “.” and “..” links.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 64
65. Device files are used to interface physical
devices (ex: console, modem) with
application programs.
Device files may be character-based or
block-based
The only differences between device files
and regular files are the ways in which
device files are created and the fact that
lseek is not applicable for character
device files.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 65
66. To create:
int mknod(const char* path_name, mode_t
mode,int
device_id);
The mode argument specifies the access
permission of the file
The device_id contains the major and
minor device numbers. The lowest byte of
a device_id is set to minor device number
and the next byte is set to the major
device number.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 66
67. When a process reads from or writes to a
device file, the file’s major device number
is used to locate and invoke a device
driver function that does the actual data
transmission.
The minor device number is an argument
being passed to a device driver function
when it is invoked. The minor device
number specifies the parameters to be
used for a particular device type.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 67
68. A device file may be removed via the
unlink API.
If O_NOCTTY flag is set in the open call,
the kernel will not set the character device
file opened as the controlling terminal in
the absence of one.
The O_NONBLOCK flag specifies that the
open call and any subsequent read or
write calls to a device file should be
nonblocking to the process.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 68
69. These are special device files used for
interprocess communication .
These are also known as named files
Data written to a FIFO file are stored in a
fixed-size buffer and retrieved in a
first-in-first-out order.
To create:
int mkfifo( const char* path_name, mode_t
mode);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 69
70. When a process opens a FIFO file for
read-only, the kernel will block the
process until there is another process that
opens the same file for write.
If a process opens a FIFO for write, it will
be blocked until another process opens
the FIFO for read.
This provides a method for process
synchronization
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 70
71. If a process writes to a FIFO that is full,
the process will be blocked until another
process has read data from the FIFO to
make room for new data in the FIFO.
If a process attempts to read data from a
FIFO that is empty, the process will be
blocked until another process writes data
to the FIFO.
If a process does not desire to be blocked
by a FIFO file, it can specify the
O_NONBLOCK flag in the open call to the
FIFO file.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 71
72. UNIX System V defines the O_NDELAY
flag which is similar to the O_NONBLOCK
flag. In case of O_NDELAY flag the read
and write functions will return a zero value
when they are supposed to block a
process.
If a process writes to a FIFO file that has
no other process attached to it for read,
the kernel will send a SIGPIPE signal to
the process to notify it of the illegal
operation.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 72
73. If
Two processes are to
communicate via a FIFO file, it is
important that the writer process
closes its file descriptor when it is
done, so that the reader process
can see the end-of-file condition.
Pipe API
Another method to create FIFO files for
interprocess communications
int pipe (int fds[2]);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 73
74. Uses of the fds argument are:
fds[0] is a file descriptor to read
data from the FIFO file.
fds[1] is a file descriptor to write
data to a FIFO file.
The child processes inherit the FIFO file
descriptors from the parent, and they can
communicate among themselves and the
parent via the FIFO file.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 74
75. These were developed to overcome
several shortcomings of hard links:
Symbolic links can link from across file
systems
Symbolic links can link directory files
Symbolic links always reference the
latest version of the file to which they link
Hard links can be broken by removal of
one or more links. But symbolic link will
not be broken.
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 75
76. To create :
int symlink (const char* org_link, const
char*
sym_link);
int readlink (const char* sym_link, char*
buf,
int size);
int lstat (const char* sym_link, struct stat*
statv);
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 76
77. To QUERY the path name to which a
symbolic link refers, users must use the
readlink API. The arguments are:
sym_link is the path name of the symbolic
link
buf is a character array buffer that holds
the return path name referenced by the
link
size specifies the maximum capacity of
the buf argument
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 77
78. Explain the access mode flags and
access modifier flags. Also explain how
the permission value specified in an
‘Open’ call is modified by its calling
process ‘unmask, value. Illustrate with
an example (10)
Explain the use of following APIs (10)
i) fcntl ii) lseek iii) write iv) close
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 78
79. With suitable examples explain various
directory file APIs (10)
Write a C program to illustrate the use of
mkfifo ,open ,read & close APIs for a FIFO
file (10)
Differentiate between hard link and
symbolic link files with an example (5)
Describe FIFO and device file classes (5)
Explain process of changing user and
group ID of files (5)
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 79
80. What are named pipes? Explain with an
example the use of lseek, link, access
with their prototypes and argument values
(12)
Explain how fcntl API can be used for file
record locking (8)
Describe the UNIX kernel support for a
process . Show the related data
structures (10)
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 80
81. Give and explain the APIs used for the
following (10)
1. To create a block device file called
SCS15 with major and minor device
number 15 and 3 respectively and access
rights read-write-execute for everyone
2. To create FIFO file called FIF05 with
access permission of read-write-execute
for everyone
Sunil Kumar R.M Lecturer Dept of
CSE RLJIT 81