meaning of @(#) characters
In documentation code I see some things like this:
/*
* @(#)Fil开发者_JAVA技巧e.java 1.142 09/04/01
what does characters like @(#) meaning?
@(#)
is the character string used by the Unix what
command to filter strings from binaries to list the components that were used to build that binary. For instance what java
on AIX yields:
java:
23 1.4 src/bos/usr/ccs/lib/libpthreads/init.c, libpth, bos520 8/19/99 12:20:14
61 1.14 src/bos/usr/ccs/lib/libc/__threads_init.c, libcthrd, bos520 7/11/00 12:04:14
src/tools/sov/java.c, tool, asdev, 20081128 1.83.1.36
src/misc/sov/copyrght.c, core, asdev, 20081128 1.8
while `strings java | grep '@(#)' yields:
@(#)23 1.4 src/bos/usr/ccs/lib/libpthreads/init.c, libpth, bos520 8/19/99 12:20:14
@(#)61 1.14 src/bos/usr/ccs/lib/libc/__threads_init.c, libcthrd, bos520 7/11/00 12:04:14
@(#)src/tools/sov/java.c, tool, asdev, 20081128 1.83.1.36
@(#)src/misc/sov/copyrght.c, core, asdev, 20081128 1.8
@(#)
was chosen as marker because it would not occur elsewhere, source code controls systems typically add a line containing this marker and the description of the file version on synchronisation, expanding keywords with values reflecting the file contents.
For instance, the comment you list would be the result of expanding the SCCS keywords %Z% %M% %R%.%L% %E%
where the %Z%
translates into @(#)
.
From (hazy) memory, that was the tag used by SCCS back in the "good old days". Given that (to my knowledge), BitKeeper uses SCCS underneath, it could be BitKeeper.
It is usually something that is added automatically by the version control system.
That construct has no special meaning in Java. It is just some text in a comment.
It looks like something that's inserted by a version control system.
精彩评论