1

I've been attempting to implement the Perl script found here: best way to add license section to iOS settings bundle

I've followed the instructions given to a T but when I go to run my project I get the following error after changing the permissions of the script to CHMOD 755:

No such file or directory at ./LicenseScript.pl line 10.
Command /bin/sh failed with exit code 2

Why won't my app compile?

Community
  • 1
  • 1
user3185748
  • 2,478
  • 8
  • 27
  • 43
  • 1
    What is on line 10 then? – TLP Jan 04 '15 at 03:01
  • Well if blank lines are counted then it is: `open(my $outfh, '>', $out) or die $!;` otherwise, the tenth line of code is ` ` – user3185748 Jan 04 '15 at 03:03
  • 1
    Yes, it will be the 10th line in the file, no matter what is before it. And that error with that line means that the path in `$out` contains a directory that does not exist. E.g. `$out = "foo/bar/baz.txt"`, but `foo/bar` does not exist. – TLP Jan 04 '15 at 03:43
  • Now, in the script `$out` is declared as `my $out = "../Settings.bundle/en.lproj/Acknowledgements.strings";`. I don't believe that Acknowledgements.strings is supposed to exist prior to running the script based on the instructions. – user3185748 Jan 04 '15 at 03:55
  • What TLP is trying to tell you is: When you open a file for writing perl will create the file if it doesn't exist, right? Wrong. open() will not create *directories*, so unless the directory `../Settings.bundle/en.lproj/` exists beforehand, then perl will not create your file. The error message is telling you that, in fact, the directory does not exist. – 7stud Jan 04 '15 at 11:45

0 Answers0