2024-08-22 02:49:44 +05:30
[![C/C++ CI ](https://github.com/pavliktt/fileinfo/actions/workflows/c-cpp.yml/badge.svg )](https://github.com/pavliktt/fileinfo/actions/workflows/c-cpp.yml)
2024-08-23 22:36:59 +05:30
# fileinfo
2024-08-20 23:09:18 +05:30
A simple C++ program that displays information about files and folders.
2024-08-23 22:36:59 +05:30
## Contents
2024-08-22 14:44:53 +05:30
* [Installation ](#installation )
* [Usage ](#usage )
* [Example ](#example )
2024-08-23 22:36:59 +05:30
## Installation
If you want the program to detect the file type more accurately, install `libmagic-dev` through your package manager, or with the `./configure` command
< br >
Then, compile the source code.< br >
```
2024-08-22 14:39:11 +05:30
make
2024-08-23 22:36:59 +05:30
```
2024-08-23 22:45:41 +05:30
Or, if you haven't installed `libmagic-dev` :
```
make nomime
```
2024-08-22 02:31:03 +05:30
And finally, copy that executable to /usr/local/bin folder. (not required)< br >
2024-08-23 22:36:59 +05:30
```
2024-08-20 23:37:33 +05:30
sudo cp fileinfo /usr/local/bin/
2024-08-23 22:36:59 +05:30
```
## Usage
```
2024-08-23 13:56:14 +05:30
./a.out [args] filename ...
Args:
-A Output absolute path
-E Do not show emojis
2024-08-23 22:36:59 +05:30
```
## Example
```
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ ls
LICENSE main.c README.md
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo main.c # Single file
📝 main.c:
Name: main.c
Type: Text
MIME: text/x-c
File size: 10.1 KB or 9.9 KiB (10110 bytes)
Permissions: -rw-rw-r--
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo main.c -A # Single file with argument
📝 main.c:
Name: main.c
Type: Text
Absolute path: /home/pavlik/rgb-terminal/main.c
MIME: text/x-c
File size: 10.1 KB or 9.9 KiB (10110 bytes)
Permissions: -rw-rw-r--
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo * # All files in this directory
📝 LICENSE:
Name: LICENSE
Type: Text
MIME: text/plain
File size: 1.2 KB or 1.2 KiB (1211 bytes)
Permissions: -rw-rw-r--
📝 main.c:
Name: main.c
Type: Text
MIME: text/x-c
File size: 10.1 KB or 9.9 KiB (10110 bytes)
Permissions: -rw-rw-r--
📝 README.md:
Name: README.md
Type: Text
MIME: text/plain
File size: 173 bytes
Permissions: -rw-rw-r--
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo . # Current directory
📁 rgb-terminal/:
Name: rgb-terminal/
Type: Folder
MIME: inode/directory
Contents:
Normal: 3 files and 0 folders.
Hidden: 0 files and 1 folders.
Permissions: drwxrwxr-x
```
2024-10-02 19:04:15 +05:30
## Coming soon
* Created, last modified and last opened dates.