ECP-VeloC / AXL

Asynchronous Transfer Library
MIT License
2 stars 8 forks source link

BB_AddFiles() checks if destination path exists (need workaround) #44

Closed tonyhutter closed 5 years ago

tonyhutter commented 5 years ago

If you AXL_Add() a file with a destination path that doesn't exist, it's totally fine, since AXL will automatically create the path for you in AXL_Dispatch(). So if you do:

AXL_Add(id, "/tmp/myfile", "/tmp/dir1/dir2/dir3/myfile")

AXL_Dispatch() will mkdir /tmp/dir1/dir2/dir3/ before copying the file.

This is an issue with the BB API, since it checks to see if the destination path exists in BB_AddFiles() (a.k.a AXL_Add()). A possible solution to this to do both the BB_AddFiles() of the entire file list, and the BB_StartTransfer() in axl_async_start_bbapi() (a.k.a AXL_Dispatch()). That way we guarantee the directories are there before we start copying the files.