FileBrowser.h is a lightweight C library to navigate and select files directly from the terminal.
Simply put file_browser.h in your includes folder.
Yeah it's simple like that
You can download with that :
curl -O https://raw.githubusercontent.com/squach90/FileBrowser.h/refs/heads/main/file_browser.hor
wget https://raw.githubusercontent.com/squach90/FileBrowser.h/main/file_browser.h`To use file_browser.h in a C file you need to adds:
#include "../includes/file_browser.h" // If needed you can adjust the pathThen you can call select_file() to launch the file browser:
char *file_path = select_file(); // Launch file_browser.h
if (file_path) {
printf("Selected File : %s\n", file_path);
free(file_path); // free the memory
} else {
printf("No file selected.\n");
}#include <stdio.h>
#include "file_browser.h"
int main(void) {
char *file_path = select_file(); // Launch file_browser.h
if (file_path) {
printf("Selected File : %s\n", file_path);
free(file_path); // free the memory
} else {
printf("No file selected.\n");
}
return 0;
}- Works in terminal using arrow keys to navigate and Enter to select.
- Only supports Unix-like systems (Linux/macOS) because of
termiosandunistd.h.
- Standard C –
stdio.h,stdlib.h,string.h - POSIX / Terminal –
unistd.h,dirent.h,termios.h,sys/stat.h,limits.h
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.