Posts
179
Following
26
Followers
383

There’s gotta be a better way…

use std::env;
use std::path::Path;

fn usage(arg: &String) {
    let path = Path::new(arg);

    println!("usage: {} a b", path.file_name().unwrap().to_str().unwrap());
}

fn main() {
    let args = env::args();

    if args.len() < 3 {
        usage(&args.collect::<Vec<String>>()[0]);
    }
}
0
0
1

@mripard Yes, I found that. But you still have the extra step of creating the directory structure. It’s possible, but still annoying and not as trivial as C. But I guess that should be the tagline for Rust. Not as trivial as C

0
0
2

@mripard Yeah, I found that. Still not as easy as just creating a bunch of C files, and typing make foo and if will compile foo.c

0
0
1
Using the holiday break to learn Rust, I'm getting frustrated with Cargo. I mean, with C, I have a bunch of small programs that I use. But it seems that with Rust, to do the same, I have to make each one into a separate project, which I find overkill. Is there a easy way to make 100 little programs without making a 100 little projects???
0
2
6

@monsieuricon Will it affect what apps to use it with?

1
0
0

@monsieuricon Honestly, I have no idea what the difference would be.

1
0
0

@wagi Because only the Linux kernel seems to care about not breaking user space.

0
0
1
@monsieuricon @mattblaze there's been several times I found news about things I was unaware of from social media, as my news feeds always try to predict what I'm interested in (forcing me into a bubble as it's based on what I click on). I enjoy seeing articles posted by others as they are not usually within my normal interests.
0
0
0
That was fun. Added two more HDs to my workstation, but accidentally unplugged the power of one of the existing HDs. Thought the new HDs caused my existing md-raid1 to get screwy, and I had to re-add to the existing array as it was down a drive. I accidentally picked my external backup drive (blowing away all my backups). When I finally noticed, I shutdown the machine, plugging in the HD and on booting up, it picked the HD that was powered off as the main drive for the raid1! I spent a good half hour fixing all this. 😛
0
0
1

@joe-lawrence Emacs is more than an operating system. It’s an orchestra.

0
0
0
@kernellogger Of course, the machine that has this memory, isn't something I'm using a browser on, nor even a desktop environment. 😉
0
0
0

With 256G of RAM, should I even bother with adding swap?

0
0
1

@b0rk The golden rule of debugging:

‘’’ When everything you have done you know is correct, but it still doesn’t work. Something you are sure of is wrong. ‘’’

0
0
1
I'm having way too much fun with my new server and having hot swap hard drives.
0
0
1
I have to say, the people at TechSupplyDirect are really eager to help out. Just got a call about my new Dell Server asking me if there's anything they can do to help me out, and if I have any issues, feel free to call them.
0
0
0
I was hoping to post this when we had had next year's venue locked down, but we are still not there yet. Anyway, Thanks for all the krill! https://lpc.events/blog/2022/index.php/2022/12/03/thats-a-wrap-thanks-everyone-for-linux-plumbers-2022/
0
8
12
Show older