There is a character called EOF. It's also called control-Z.
If you want to include it in a string, you have to type it as "\u001a" as in:
String iHaveAnEof = "file ends here\u001a";
Credits:
Ed Staub
http://stackoverflow.com/a/7591594/129497
String iHaveAnEof = "file ends here\u001a";
> tar --exclude "._*" -zcvf template.tgz template template/ template/.classpath template/.project template/build.xml template/src/ template/src/log4j.properties template/src/main/ template/src/main/dml/ template/src/main/dml/domain.dml template/src/main/java/
> tar -zcvf template.old.tgz template template/ template/._.classpath template/.classpath template/._.project template/.project template/._build.xml template/build.xml template/._src template/src/ template/src/._log4j.properties template/src/log4j.properties template/src/._main template/src/main/ template/src/main/._dml template/src/main/dml/ template/src/main/dml/._domain.dml template/src/main/dml/domain.dml template/src/main/._java template/src/main/java/
# disable special creation/extraction of ._* files by tar, etc. on Mac OS X echo "[/etc/profile] disable special creation of ._* files" COPYFILE_DISABLE=1; export COPYFILE_DISABLE
# from man bsdtar --disable-copyfile Mac OS X specific. Disable the use of copyfile(3).