The major difference between attachments and enclosures in traditional media is really as slight as a staple or other mechanism of close placement physically binding the two documents together, and the terms tell the reader of the main document where to find the mentioned additional article. Enclosed tells me to look in the envelope, where attachment tells me to expect it to be bound to the main document. What you describe is probably best termed enclosure if you are handing in a package containing a disk or jump drive, or attachment if it is printed source code stapled to the document.