Splitting multi-record FASTA file in individual FASTA files

Starting from an example FASTA file with proteins from P. falciparum called P-falciparum-proteins.fasta, the exercise consist in writing a script which has a function split_fasta which has two arguments, the filename of the FASTA file as first and the path of directory as second argument.

The function should do the following:

After the function is executed, generate a file listing of the current directory and print out all file paths on stdout.

Example of the file listing:

A0005w-pep.fasta
A0010c-pep.fasta
A0015c-pep.fasta
A0020w-pep.fasta