Clobbering

Clobbering

In software engineering, clobbering a file or computer memory is overwriting its contents. The Jargon File defines clobbering as "overwrit[ing], usually unintentionally: 'I walked off the end of the array and clobbered the stack.' Compare mung, scribble, trash, and smash the stack."[1]

Often this happens unintentionally, e.g., using the > redirection operator. To prevent unintentional clobbering, various means are used. For example, the setting shell parameter set -o noclobber (bash, ksh) or set noclobber (csh, tcsh) will prevent > from clobbering by making it issue an error message instead:[2]

$ echo "Hello, world" >file.txt
$ echo "This will overwrite the first greeting." >file.txt
$ set -o noclobber
$ echo "Can we overwrite it again?" >file.txt
-bash: file.txt: cannot overwrite existing file
$ echo "But we can use the >| operator to ignore the noclobber." >|file.txt
$ # Successfully overwrote the contents of file.txt using the >| operator
$ set +o noclobber # Changes setting back

In makefiles, a common target clobber means complete cleanup of all unnecessary files and directories produced by previous invocations of the make command.[3] It is a more severe target than clean and is commonly used to uninstall software. Some make-related commands invoke "make clobber" during their execution. They check the CLOBBER environment variable. If it is set to OFF then clobbering is not done.[4]

In assembler programming, the term 'clobbered registers' is used to denote any registers whose value may be overwritten during the course of executing an instruction.

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • clobbering — clob·ber || klÉ’bÉ™ v. defeat, smash, pound mercilessly; paint over a decoration, cover a decoration with paint …   English contemporary dictionary

  • clobbering, get a —  Suffer defeat, set back, harsh reprimand or punishment …   A concise dictionary of English slang

  • 1975 Boston Red Sox season — MLB yearly infobox alt name = Boston Red Sox season = 1975 misc = 1975 AL Champions 1975 AL East Champions current league = American League y1 = 1901 division = Eastern Division y2 = 1969 Uniform ballpark = Fenway Park y4 = 1912 city = Boston,… …   Wikipedia

  • clobber — I. noun Etymology: origin unknown Date: 1879 slang British clothes 1 II. transitive verb (clobbered; clobbering) Etymology: origin unknown Date: circa 1943 1. to pound mercilessly; …   New Collegiate Dictionary

  • Fantastic Four — This article is about the superheroes. For other uses, see Fantastic Four (disambiguation). Fantastic Four Promotional art for Fantastic Four #509 (March 2004) by Mike Wieringo and Karl Kesel …   Wikipedia

  • Curse of the Bambino — Babe Ruth The Bambino in his earlier days as a pitcher for the Red Sox The Curse of the Bambino was a superstition cited as a reason for the failure of the Boston Red Sox baseball team to win the World Series in the 86 year period from 1918 to… …   Wikipedia

  • Mister Mxyzptlk — Mr. Mxyzptlk. Art by Ed McGuinness. Publication information Publisher DC Comics First appearance …   Wikipedia

  • Big Guy and Rusty the Boy Robot — The Big Guy and Rusty the Boy Robot is a comic book by Frank Miller and Geof Darrow and an eponymous animated television series.Comic Book Big Guy and Rusty, the Boy Robot appeared under Dark Horse Comics now defunct Legend imprint as a large… …   Wikipedia

  • Sally Brown — Peanuts character name=Sally Brown caption= age=6 gender=Female family=Brother Charlie Brown and unnamed parents birthday=May 26, 1956Sally Ann Brown is the younger sister of Charlie Brown in the comic strip Peanuts by Charles… …   Wikipedia

  • Eiken (manga) — Infobox animanga/Header name = Eiken caption = ja name = エイケン ja name trans = genre = Comedy EcchiInfobox animanga/Manga title = author = Seiji Matsuyama publisher = flagicon|Japan Akita Shoten demographic = Shōnen magazine = Shōnen Champion… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”