PDA

View Full Version : Need help on mount nfs drive in Qt



tho97
26th November 2007, 19:51
Can anyone show me how to mount a drive in Qt.

in shell command in linux, I can use mount -t nfs drive:/home/test /mnt/test

but how I can do it in Qt.

Also I want to copy all files in my test dir to that /mnt/test.
like in linux command I can use cp * /mnt/test

Thanks,

TN

wysota
26th November 2007, 23:34
You can use system() or QProcess() to call the above mentioned command to mount the drive. Then you can use QFile::copy() to copy those files.

tho97
28th November 2007, 19:23
thank for your help, I just build a script and call Qprocess to do it.

wysota
28th November 2007, 19:26
Note that if the script is short, using system() might be more straightforward as it allows you to make the call synchronous.