Forum Discussion
mssparkutils.fs.mv is giving : java.io.IOException: when trying to move files
- 2 years ago
Hi Anonymous have you tried adding the parameters that create the destinations directory?
mssparkutils.fs.mv(file.path,updated_path,True,True)From MS docs: Microsoft Spark Utilities (MSSparkUtils) for Fabric - Microsoft Fabric | Microsoft Learnmssparkutils.fs.mv('source file or directory', 'destination directory', True) # Set the last parameter as True to firstly create the parent directory if it does not exist
mssparkutils.fs.mv('source file or directory', 'destination directory', True, True) # Set the third parameter to True to firstly create the parent directory if it does not exist. Set the last parameter to True to overwrite the updates.
Hi Anonymous
I used your code to move files from one workspace to another workspace without experiencing any error. I tried mssparkutils.fs.mv and mssparkutils.fs.cp, both worked. What error did you get when moving files? Is there any error message?
In addition, if you move files to a workspace which locates in the same Fabric Capacity as the source Workspace does, will it succeed?
More information: in my testing, I was using ABFS paths and moving files across workspaces within the same Fabric Trial Capacity.
Best Regards,
Jing
- Anonymous2 years agoNot applicable
Hi,
For me as well, cp worked but mv was giving IOException error as mentioned in my post. Also I have created shortcuts and by using that shortcuts I was trying to move files from workspace to another in two different subcriptions.