You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Asset::copy("legit-src", "non-existant-destination") or asset.write("non-existant-destination"), the call will raise an error if the destination path does not exist for a LocalAsset.
Potential solution would be to check if the destination Path is a valid directory and create it (plus any parent directories) if not using something like fs::create_dir_all before the complete destination path (including filename) is built.
e.g.
let dest_path = Path::new(dest_dir);if !dest_path.is_dir(){
std::fs::create_dir_all(dest_path)?;}
If this is intended behaviour then feel free to ignore this!
The text was updated successfully, but these errors were encountered:
hey @Tyrannican ! thanks for filing, this is actually a feature we need for our project oranda and so i'll likely implement something like this for 0.2.0 (about to cut a 0.1.0 right now)
i suspect instead of modifying the current function i'll probably build a write_all function that will create the dir if it doesn't exist. (oranda needs a few dir functions that you can see on the tracker :) )
When using
Asset::copy("legit-src", "non-existant-destination")
orasset.write("non-existant-destination")
, the call will raise an error if the destination path does not exist for aLocalAsset
.Potential solution would be to check if the destination
Path
is a valid directory and create it (plus any parent directories) if not using something likefs::create_dir_all
before the complete destination path (including filename) is built.e.g.
If this is intended behaviour then feel free to ignore this!
The text was updated successfully, but these errors were encountered: