software licensing
Does the license need to be specified in every file of a project?
<p>It is common for open source projects to have a <code>LICENSE</code> file containing (obviously) the project's license.</p>
<p>It is however also common for open source projects to copy said license in each file of the project (usually at the top).</p>
<p>I don't understand the point of doing this; surely if a file doesn't specify another license then the project's license applies (otherwise what's the point of a project-wide license file), making it pointless to copy it hundred of thousands of times across the project. I'm assuming I'm missing something, probably a legal gotcha, or maybe project-wide license files have no legal meaning and are just informal hints and the license must be specified in each file? Hence my question here:</p>
<p><strong>Why would we copy the project's license (in the <code>LICENSE</code> file) to each file in the project? What would be legally different if we didn't?</strong></p>
<p>(I would've assumed someone else asked this already, but I haven't found anything)</p>

<p>You have copyright in the code you write automatically, from the moment you write it (you don't specify a jurisdiction, but this is true pretty much everywhere). Copyright notices are placed to <a href="https://copyrightservice.co.uk/copyright/p03_copyright_notices" rel="nofollow noreferrer">put any reader on notice of this fact</a>, and to provide them with information about who owns the copyright.</p>
<p>Once you have written the code you can allow others to copy and use it by providing them with a license, meaning a set of permissions that you choose to give them. As long as it is clear what is being licensed and under what terms there is no problem.</p>
<p>The practice of putting a copyright header (not license terms) at the top of every file emerged as standard practice some decades ago. It doesn't have any particular legal rationale; it is simply a reasonable compromise between space and notification. Putting a comment saying &quot;This file is part of the Foobar Library © Joe Bloggs 2017&quot; also helps to clearly define what files the license covers (along with other things such as grouping under a common folder and distribution as a single zip file). The question of whether a particular file is part of the licensed work is a matter of fact, not law.</p>
<p>If a dispute of licensing and copyright gets that far, a court will take notice of standard industry practice and expect that the parties will be aware of it. So since a file called &quot;LICENSE&quot; in the top level of the project directory is standard practice for licensing terms, that would be considered to have put any recipients on notice of the terms of the license. Putting a reference to the file in the header comment is so simple and cheap that its probably a good idea, but failing to do so probably wouldn't affect a court case.</p>
<p>So in conclusion you are correct: copying the entire license text to the top of every source file is pointless; it gets you nothing that usual practice would not do.</p>
<p>(Personal anecdote: back in the 80s my employer sent a lawyer round to explain to us the importance of putting the actual © symbol in our source code: the &quot;(c)&quot; convention apparently didn't cut it. In vain did we explain that ASCII didn't include a copyright symbol so he was asking the impossible. His attitude was that he had done his job in explaining the law, and now it was our job to sort out the technical details.)</p>

<p>There, actually, is an official <a href="https://www.gnu.org/licenses/gpl-faq.en.html#NoticeInSourceFile" rel="nofollow noreferrer">answer</a> to your question</p>
<blockquote>
<p>You should <strong>put a notice at the start of each source file</strong>, stating
what license it carries, <strong>in order to avoid risk of the code's
getting disconnected from its license</strong>. If your repository's README
says that source file is under the GNU GPL, what happens if someone
copies that file to another program? That other context may not show
what the file's license is. It may appear to have some other license,
or no license at all (which would make the code nonfree).</p>
</blockquote>
<p>(I highlighted two half sentences)</p>
