Question: I am trying to copy a file into another folder, here is my code.

```cs
private static void CopyDirectory(DirectoryInfo source, DirectoryInfo target)
{
    foreach (var sourceFilePath in Directory.GetFiles(source.FullName))
    {
        FileInfo file;

        if(IsAccesable(sourceFilePath, out file))
        {
            file.CopyTo(target.FullName); //ERROR HERE
        }
        else
        {
            //DO WORKAROUND
        }
    }

    foreach(var sourceSubDirectoryPath in Directory.GetDirectories(source.FullName))
    {
        DirectoryInfo directory;

        if(IsAccesable(sourceSubDirectoryPath, out directory))
        {
            var targetSubDictionary = target.CreateSubdirectory(Path.Combine(target.FullName, sourceSubDirectoryPath));
            CopyDirectory(directory, targetSubDictionary);
        }
        else
        {
            //DO WORKAROUND
        }
    }
}

```

I keep getting the error message: The target path "" is a directory and not a file

Full sourcePath:

```
"c:\\Hypixel Bots Interface\\.gitattributes"

```

Full targetPath:

```
"C:\\Users\\wout\\source\\repos\\FileCloner\\FileCloner\\bin\\Debug\\net5.0\\Target\\Hypixel Bots Interface"

```

Answer: 
```
def product_index(request):

    title = "My Products"
    products = Product.objects.all()
    order = get_cart(request)
    cart = Order.objects.get(id=order.id, complete=False)
    items = cart.orderitem_set.all()

    # Changes
    for product in products:
        qty = 0
        if items.filter(product=product).exists():
            qty = items.get(product=product).quantity
        setattr(product, 'quantity_in_cart', qty)

    context = {
    'title' : title,
    'products' : products,
    'cart' : cart,
    'items': items
    }
    return render(request, "store/product_index.html", context)

```
Add a session key called 'cart' which can be a list and each item in the list can be a dictionary containing 'name', 'quatity' and price, as the the user is adding to the cart you add you the session variable and in the template you can render the cart using a for like this

```
{% for product in request.session.carr%}
 {%endfor%}

```