dirs-cli 0.1.0

A tiny low-level command line application that provides platform-specific standard locations of directories for config, cache and other data on Linux, Windows, macOS and Redox by leveraging the mechanisms defined by the XDG base/user directory specifications on Linux, the Known Folder API on Windows, and the Standard Directory guidelines on macOS.
1
2
3
4
5
6
7
8
9
10
11
use std::fs::File;
use std::io::{Write, Result};
use std::os::unix::io::FromRawFd;

pub(crate) fn stdout() -> File {
    unsafe { File::from_raw_fd(1) }
}

pub(crate) fn write(console: &mut File, buf: &[u8]) -> Result<usize> {
    console.write(buf)
}