Will files, creaetd in one function of the same script will be recognized in another function?

Dear All.

I have a script, which process files one by one. In the script I have two functions.
one sftp files to different server
the other from existing file create file with different name.
My question is:
Will sftp function recognize files names , which are created in another function, or I have to provide file name as argument?

Pass the file name as an argument.