chinhdo/txFileManager

DeleteDirectoryOperation fails if temp directory is on a different device.

Closed this issue · 5 comments

Issue copied from CodePlex:

Firstly, thank you for TxFileMgr, it's amazing, and we're using it to do good things. Unfortunately, I managed to find a bit of a stumbling block recently when it comes to deleting directories.

The use of GetTmpFileName in DeleteDirectoryOperation.cs may end up with a path that's on a different device to the directory we're deleting. Consequently, the subsequent move operations fail, as directories cannot be moved across filesystem boundaries¹.

A good fix for this would be allowing a temp directory to be provided as an optional argument on TxFileMgr object creation, allowing the application to specify where temporary files should be housed. This should default to querying GetTmpFileName if no argument is provided.

Note that this bug only affects directories; as TxFileMgr copies rather than moves files, they are unaffected by filesystem boundaries.

Many thanks!

~ Paul

¹ At least on Linux.
Hi Paul, Thanks!

Yes I think providing an option to set the Temp folder would work for this issue. I'll work on that... unless anyone else wants to take it.
2014-11-04
You are awesome. Thank you! :)
2014-11-04
Active
#20 | Created 2014-11-03 | Updated 2017-12-14

Added support to specify your own temp path to get around this issue. Will be in 1.4.

Hi a,

When will version 1.4 release, I'm really looking forward seeing that version on nuget ?

Hi @binhphanduc Just doing some more testing before I hit the button. Should take a few more days. Thanks

Hi @binhphanduc I just pushed 1.4 to NuGet. Thanks.

thanks @chinhdo 💃