my $uploaded_file = shift;
my $directive_only = shift;
+ # scaffolding: will later derive file names from stem
+ die "directive file name does not match expected pattern"
+ unless $directive_file =~ m/^(.*)[.]directive[.]asc/;
+ my $stem = $1;
+ # The following error is not possible because packets are recognized by
+ # their stems. This check will be removed later.
+ die "uploaded file name does not match stem"
+ unless $directive_only || $uploaded_file eq $stem;
+
my $directive_file_contents = slurp_directive_file($directive_file);
my $directive = read_directive_from_string($directive_file_contents);