Dan Lincan
Dan Lincan

Reputation: 1065

qt windows share

I want to make an application in qt 4.7.4 where I need to use shared folders in Windows.

I have searched around and found that I can use QDir(hostName), but there is a problem: I can't control the bandwidth used. I'd like to be able to set the max transfer rate when accessing a host in the network.

More about the app: I have a folder on my computer whose content I wish to be identical on all the hosts(who's name will be provided from a file) in my network . For example if I add a new file in that folder and run the app, it should start copying the file in the hosts with the max bandwidth used specified by me.

Thank you in advance for your help.

Upvotes: 2

Views: 903

Answers (1)

tim
tim

Reputation: 788

I suppose that bandwidth manages by operating system drivers or services like QoS or firewalls. QDir use only interface provided by operating system to access directory. It works fine with shared dir only because of Windows shared dir behaves the same way as usual dir.

By the way you may try control bandwidth manually by implementing your own file copy procedure. Sorry if my solution too naive or doesn't fit. You may open file (see QFile) in shared directory for read-only and open file on local machine in write-only. Next you start reading portions of data from shared file by timer (see QTimer). So you can specify how often you want to copy portions of data (QTimer parameter) and how many bytes of data you copy per time (QIODevice::read function parameter).

Upvotes: 1

Related Questions