Skip to content
Archive of posts filed under the C Programs category.

Convert string to hex.

If you want to use snoop or tcpdump with advanced search in the packet, then you would need to convert the string to hex string. For this, either you can use a web search and find some web application to do that or you can use a simple C program like this /* * ===================================================================================== [...]

Inotify Example: Introduction to Inotify with a C Program Example

Inotify Example: Introduction to Inotify with a C Program Example: inotify utility is an effective tool to monitor and notify filesystem changes. You can specify a list of files and directories that needs to be monitored by inotify. This library is used by various other programs. For example, CPAN module Linux::Inotify is developed based on [...]

Last access time for file

The C program will print the last access time for the file. This is quite helpfull program when you want to find old files. Modifying the source to take the filename as argument and take multiple arguments is left as an exercise. #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <fcntl.h> #include <time.h> #include <stdlib.h> int [...]