notexists.pl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env perl
  2. #***************************************************************************
  3. # _ _ ____ _
  4. # Project ___| | | | _ \| |
  5. # / __| | | | |_) | |
  6. # | (__| |_| | _ <| |___
  7. # \___|\___/|_| \_\_____|
  8. #
  9. # Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
  10. #
  11. # This software is licensed as described in the file COPYING, which
  12. # you should have received as part of this distribution. The terms
  13. # are also available at https://curl.haxx.se/docs/copyright.html.
  14. #
  15. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. # copies of the Software, and permit persons to whom the Software is
  17. # furnished to do so, under the terms of the COPYING file.
  18. #
  19. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  20. # KIND, either express or implied.
  21. #
  22. ###########################################################################
  23. # Check that given arguments do not exist on filesystem.
  24. my $code = 0;
  25. if ($#ARGV < 0) {
  26. print "Usage: $0 file1 [fileN]\n";
  27. exit 2;
  28. }
  29. while (@ARGV) {
  30. my $fname = shift @ARGV;
  31. if (-e $fname) {
  32. print "Found '$fname' when not supposed to exist.\n";
  33. $code = 1;
  34. }
  35. }
  36. exit $code;