Can someone explain to me why make
can freely overwrite existing files? For instance:
JAVA_FILES = example.java, example2.java
submit: example.zip
example.zip: $(JAVA_FILES)
zip $@ $^
In the terminal, not-rooted I type this and get what I expect:
user@computer :~$ make submit
zip example.zip example.java, example2.java
adding: example.java (deflated 53%)
adding: example2.java (deflated 53%)
What I did not expect is that if I now make a small change to example.java
(for instance), and make submit
again, the old file is overwritten without any kind of prompting. How is it possible that it doesn't need (my) permission to overwrite or sudo?
If -- on your behalf -- make
can create the .zip
file in the first place, then there's no special reason to suppose that make
cannot also modify the file on your behalf. The make
program is not operating as some independent third party: when you run it, it is operating as you (for whatever the current sense of "you" is). The only reason to suppose that it might have a permission issue is if your default umask is set to disallow you modifying files you create, say 0222
. That would be very unusual, and inconvenient.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments