Search
 
SCRIPT & CODE EXAMPLE
 

RUST

rust create folder

use std::fs;

fn main() -> std::io::Result<()> {
    fs::create_dir("/some/dir")?;
    Ok(())
}
Comment

rust create directory

let mut current_dir = env::current_dir().unwrap();
current_dir.push("sub_dir_one");
current_dir.push("sub_dir_two");
create_dir_all(&current_dir).unwrap();

current_dir.push(format!("filename_{}.json", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs()));
let mut new_file = File::create(current_dir).unwrap();

new_file.write_all("content").unwrap().as_bytes()).unwrap();
Comment

PREVIOUS NEXT
Code Example
Rust :: rust print array 
Rust :: exit program rust 
Rust :: bevy bundles 
Rust :: rust bevy query option 
Rust :: bevy assets image as sprite 
Rust :: rust nesting and labels loop 
Rust :: rust lang print in hex 
Rust :: rust read lines from stdin and return a vec 
Rust :: rustlang string 
Rust :: rust file extension 
Rust :: rust lang display 
Rust :: rust round 2 decimal places 
Rust :: char to upper case rust 
Rust :: rust initialize empty array 
Rust :: rust undefined size array 
Rust :: rust convert binary data into ASCII text using Base64 RFC 4648. 
Rust :: armanriazi•rust•error•[E0369]: binary operation `=` cannot be applied to type `T` 
Rust :: rust return the result with trait exit status 
Rust :: armanriazi•rust•concept•dst•or•unsizedtype 
Rust :: blank struct rust 
Rust :: rust month to quarter 
Lua :: lua dump table 
Lua :: luau how to make a kill brick 
Lua :: os.date lua 
Lua :: length of table lua 
Lua :: while true do lua 
Lua :: roblox table find 
Lua :: How to split license id fivem 
Lua :: how to make a day/night script roblox 
Lua :: how do i use the errors module luaassist 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =