Title: Recursive Function – Practical Application Example
1Recursive Function Practical Application Example
www.epiphanyinfotech.com
2INTRODUCTION
A recursive function has many definitions but at
its core, all it means is that its a function
that calls itself repeatedly and is usually
stopped when a particular condition is met.
3THE REQUIREMENT
So, we were given a task to add a snippet of code
on the top of all the files in a folder and its
sub-folder and their files. And not only that, we
also had to replace some content (old URL) with a
new one.
MORE
www.epiphanyinfotech.com
4THE CODE
The first thing to do is to create an HTML form
where we could input the folder name which would
be the master folder having all the sub-folders
and files.
MORE
5Epiphany Infotech
The function recursive_func takes two parameters,
the first being the master folder or the source
folder name and the second being the state of the
folder existing or not, the default being not, in
case its not provided.
The Main Recursive Function
MORE
6CONTACT US
Phase 8, Industrial Area, S.A.S Nagar, Punjab,
160059
123-456-7890
www.epiphanyinfotech.com