Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
NNirav
Posts: 3
Registered: ‎01-21-2013
My Device: blackberry curve

How to move a file from one location to another

Hello BB10Programers,

               I am newbie in bb10.From the documentation i have found some samples for creating and making a dir.After thta i have implemented  onesample app which will  make dir,creatre file,rename file ,delete file.Buy now I am unable to move that file from on location to another location.I have seen some method using QFile s object but there is no method for move.Please provide any link or concrete examples if possible.

                                                                                                                                                                                        Thanks

                                                                                       :Cowboy:

Developer
oniongarlic
Posts: 72
Registered: ‎10-19-2012
My Device: Playbook, BB10DevAlphaB

Re: How to move a file from one location to another

You can use .rename() or a combination of .copy() and .remove()
Rename is more or less the same as a move when used on the same filesystem.
What exactly are you trying to achieve ?
New Contributor
NNirav
Posts: 3
Registered: ‎01-21-2013
My Device: blackberry curve

Re: How to move a file from one location to another

Thank you for the answer,

                   Actually i have created one directory as data/file/text/current.txt and  in that directory i have created one file called newfile.txt.Now i want to move that file from its current location to another location.So  how would i do it?lets say i have a another directory called data /newdir/ .Now how would I store my  current file to this location?

Developer
dishooom
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810

Re: How to move a file from one location to another

Hi

 

Have you tried out QFile::Copy

 

QFile::copy("path1/file_xyz","path2/file_xyz");

 Although i havnt tried this out,,, i think this should work.

 

_ Dishooom