This Library Management System uses Operating Systems concepts to build a command-line application developed in C, designed to facilitate efficient management of library books and user accounts. The LMS supports essential library functionalities such as user account management, book lending, and return operations. It operates in a distributed environment using socket-based client-server communication and is designed to handle concurrent users through threading.
- View Books: Browse all available books in the library.
- Borrow/Return Books: Borrow available books and return borrowed books.
- View Borrowed Books: See a list of books currently borrowed by the user.
- Search Books: Search for books by title or author.
- User Management: Add or remove members.
- Book Management: Add new books, delete books, and view all books in the library.
- Transaction Management: Lend books to members and accept book returns.
- View User Details: Display information on all members or search by username.
- Operating System: Linux
- Compiler: GCC for compiling C programs
- Libraries:
pthreads
for concurrent operations
-
Clone the repository:
git clone https://github.com/NikitaKiran/OS_LMS.git cd OS_LMS
-
Compile the code:
gcc init.c -o init gcc server.c -o server -lpthread gcc client.c -o client -lpthread
-
Run the inititialisation
./init
-
Run the server:
./server
-
Run the client (in a separate terminal):
./client
The system is designed for command-line usage with separate interfaces for Admin and User roles. The user can choose the required option from the displayed menu to perform the necessary action.
The LMS consists of a server that manages all data operations and multiple clients that interact through TCP/IP socket communication. Using threads, the system allows concurrent access for multiple users while maintaining data integrity with mutex locks for safe read/write operations.
All data, including user and book information, is stored in binary files to ensure quick access and recovery in case of failures.
The LMS uses file locks to ensure secure and consistent data management across concurrent client interactions.