os_files
Crossplatform (x11, windows, osx) native file dialogs; sytem file/folder icons in any resolution; open file with default application
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:24 |
Tags
Installation
nimble install os_files
choosenim install os_files
git clone https://github.com/tormund/os_files
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| os_files | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/tormund/os_files |
|---|---|
| Homepage | https://github.com/tormund/os_files |
| Registry Source | nimble_official |
README
OS_FILES
Native file dialogs (x11, windows, osx) with extension filters and predefined path. System file icons in any resolution (x11 with theme support, windows, osx). Open file with system default application (x11, windows, osx).
File Dialogs Example
Supported platforms: * X11 * OSX * Windows * WIP: web (JavaScript)
import os_files.dialog
var di:DialogInfo
# required: dialog kind - one of dkOpenFile dkSaveFile dkSelectFolder dkCreateFolder
di.kind = dkSaveFile
# optional: dialog's title
di.title = "Test dialog"
# optional: override current folder path
di.folder = "C:\\Users\\tormund\\devel"
# optional: extension filters
di.filters = @[(name:"JSON", ext:"*.json"),(name: "Picture", ext:"*.png")]
# optional dkSaveFile only: to automaticaly append extension
di.extension = "rod"
# call modal dialog
let path = di.show()
# validate dialog result
if path.len > 0:
#[
your code here
]#
System Icons Example
Supported platforms: * X11 * OSX * Windows
import os_files.file_info
## path to file or folder
let path_to_file: string = "/home"
## get icon bitmap data
let iconSize = 128
let icon_bitmap_data = iconBitmapForFile(path_to_file, iconSize, iconSize)
## do something with bitmap data
## for example create image using Nimx
if not icon_bitmap_data.len > 0:
let image = imageWithBitmap(cast[ptr uint8](icon_bitmap_data), iconSize, iconSize, 4)
Open file with default application Example
Supported platforms: * X11 * OSX * Windows
import os_files.file_info
let path_to_file = "/home/example_image.png"
openInDefaultApp(path_to_file)