Can programming screw my computer

Started by
21 comments, last by Hraefn 10 years, 5 months ago


the really bad command(That wintertime were probably refering to) would be rm-rf /*
/ is the root directory on a *nix system so everything (included mounted secondary or external harddrives) will have their files deleted (assuming your user has the right to actually delete all files).

It's worth noting that this command is infamous enough that in most Linux distributions you will find that the rm utility now features a built-in failsafe which will either ask you if you really intended to erase your entire system, or will outright forbid it without being passed some awkward flag (e.g. --no-preserve-root). So it can be hard to do it accidentally these days on recent operating systems.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

Advertisement
Even if the current user does not have root access, it still recurses down and wipes out your home directory and any mounted memory sticks (more of a poke in the eye rather than a punch in the face but still not pleasant ;))

Most programming languages provide their own file handling system so it is rare that you would need to call "rm" using system(). This means that it is very unlikely that a developer does this by accident.
http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

Even if the current user does not have root access, it still recurses down and wipes out your home directory and any mounted memory sticks (more of a poke in the eye rather than a punch in the face but still not pleasant ;))

Most programming languages provide their own file handling system so it is rare that you would need to call "rm" using system(). This means that it is very unlikely that a developer does this by accident.

Good programs only run and use resources when they are used. Sadly there are more and more bad programs with autoupdaters uselessly phoning home every few seconds the whole time your computer runs or preloaders that are supposed to make a single bloated program start a tiny bit faster (in the rare case you would want to use it) in expense of always slowing down booting and all other programs.

As for the danger. There are stupid things you can do like making an "rm -rf *" shell script, but normally your computer should survive.tongue.png

What is "rm -rf *" it is a code to deleting system?blink.png

it is a unix/linux command, rm is the remove file command. (similar to the "del" command in DOS and the windows command prompt), -rf are flags, r is for recursive (remove subdirectories and their content as well) and -f is for force (no yes/no promts, just do it) and * means all files in the current directory.

the really bad command(That wintertime were probably refering to) would be rm-rf /*

/ is the root directory on a *nix system so everything (included mounted secondary or external harddrives) will have their files deleted (assuming your user has the right to actually delete all files).


the really bad command(That wintertime were probably refering to) would be rm-rf /*
/ is the root directory on a *nix system so everything (included mounted secondary or external harddrives) will have their files deleted (assuming your user has the right to actually delete all files).

It's worth noting that this command is infamous enough that in most Linux distributions you will find that the rm utility now features a built-in failsafe which will either ask you if you really intended to erase your entire system, or will outright forbid it without being passed some awkward flag (e.g. --no-preserve-root). So it can be hard to do it accidentally these days on recent operating systems.

Wew,Thank you for the explaination ^^

This topic is closed to new replies.

Advertisement