Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# - Function to replicate the folder structure in the file path

Tags:

I need a simple function which will take a FileInfo and a destination_directory_name as input, get the file path from the fileinfo and replicate it in the destination_directory_name passed as the second parameter.

for ex. filepath is "d:\recordings\location1\client1\job1\file1.ext the function should create the directories in the destination_directory_name if they dont exist and copy the file after creating the directories.