Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Is there a way I can make the license I use for an open-source software package be valid for all contents of the package without having to write it into every single file?

I often saw a LICENSE file, but does this file (with the license in it) makes all contents of the package (i.e. the current directory and all sub-directories) use this license?

share|improve this question

marked as duplicate by gnat, Community Jan 13 at 12:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Your best option is to write a script that traverses all directories and prefixes the files with the license (for example all files that match *.c or *.h) – Shahbaz May 28 '12 at 17:05
up vote 6 down vote accepted

The legal assumption is that every file is copyrighted. You can just describe in your license what's covered. Anyone who doesn't read the license but just the sourcefile will have a subset of the rights that you granted (Open Source doesn't take away legal rights). Everyone who does read the license knows what's covered, and can exercise all the rights that you have granted.

However, good Open Source licenses (such as the GPL) provide you with guidance how to apply the license. In particular, the GPL suggests adding to every source file a small reference to the actual license.

share|improve this answer
I'm going to upvote this answer while resisting the urge to begin the age-old debate as to whether copyleft is "good" open source ;-P – TehShrike May 28 '12 at 22:23

Judging by what I've seen in many other projects, you don't need to include the entire text of your license in every file. You should, however, include your copyright notice and a reference to your license in every file. I've often seen statements along the lines of:

©2012 Joe Cool. See the license terms in the file 'license.txt' which should
have been included with this distribution. A copy of the license is also
available at <>.
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.