Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The Jarring Dilemma

 
Naresh Kumar Bhandari
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A real stupid one.

I have heard there is a difference in the following two ways of using the jar command.

In dir "temp" with other subfolders like "misc1" and "misc2".
Each of these subfolders might have other subfolders and files within them.
Even files like ".somename".

- jar -cfmv new.jar META-INF/MANIFEST.MF .
- jar -cfmv new.jar META-INF/MANIFEST.MF *

Is there difference in the way these two commands create the new.jar.
I have tried it and find no difference. But, I have heard that there is a difference.

Thanks in advance.

Regards,
Naresh.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

The answer may actually be a little system-dependent. On UNIX systems, it's up to the command shell to interpret "*", whereas on Winders, it's up to the individual application (last I knew, anyway.) "." means the current directory, and that definitely could include .dotfiles in the current directory; but "*" means only visible files, so .dotfiles in the current directory would not be included.

In both cases, though, recursive handling of the contained directories would be the same. So on UNIX-like systems, anyway, there is a small difference: .dotfiles in the top level directory (only) may be included by ".", and omitted by "*".
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic