Reputation: 145
I am writing some files using my application in c++, when I save them on network drive using std::io operation the application freezes till the file is completely written, and the process is taking time whereas on local drive it does the operation very quickly.
Is there any way we can identify directory path is on a Network drive(Mapped/Non-mapped) or not? so that i can issue a warning to user, and later break the operation to save it locally first then move the file to network in background.
PS : comparing "\\" is not an option since the drive may be mapped.
Upvotes: 2
Views: 978
Reputation: 5369
Sorry for potential off-topic polemic but it seems you're on the wrong way. Any file operation can be slow, regardless the local/remote nature of the storage.
So it's more productive to move your disk IO to another thread to provide end-users with non-freezing UI.
Upvotes: 2