05-07-2013 12:11 PM
I'm just curious, to my knowledge, there is not direct way of "renaming" a file or folder (other than going through "system exec" or "move"). Is this still the case?
A while back I needed this function with large binary files, so I'm just wondering if the new LabView versions +2012 allows this.
Thanks
Kas
05-07-2013 12:21 PM
"Move File" does exactly what you ask for.
Just wire your old filename to "source path" and your new filename to "target path", and the file is renamed.
Best regards,
Jens
05-07-2013 12:32 PM - edited 05-07-2013 12:33 PM
you could use copy.vi, where you still have the original file and renamed targeted copy
05-07-2013 12:46 PM
Sure, but either way is not straight forward when you have folders and subfolders. Just wondering why they haven't included this function. Maybe I'm missing some underlying difficulties on implementing this.
Kas
05-07-2013 01:54 PM
@zerotolerance wrote:
Sure, but either way is not straight forward when you have folders and subfolders. Just wondering why they haven't included this function. Maybe I'm missing some underlying difficulties on implementing this.
Kas
What is not straightforward about using Move File? That's what a rename does. It moves the file to another location.
05-07-2013 03:02 PM - edited 05-07-2013 03:04 PM
Sorry, looks like I misinterpreted how windows deals with this issue. I thought that when you rename a large file (e.g. a 12 GB file) in windows, only the name changes (which basically changes the path location only). But using the "move" function in labview I throught generates more disc/processor operation than simply just changing the name.
Kas
05-07-2013 03:11 PM
It's really just a naming issue. LabVIEW calls this move, DOS called it rename. in principle it is the same. If the source and target are on the same disk volume, the operation is in fact a simple rename. If the source and target are on different volumes it is a copy with subsequent delete of the original AFTER the copy has ended successfully.
10-12-2015 11:45 AM - edited 10-12-2015 11:47 AM
I'm going to hijack this old thread really quick here just to add in the solution I think OP was hoping for, so that others can find this in the future.
I came across this thread because I'm trying to rename a folder that contains 800MB of images. The Move VI takes 10 seconds to do this when the new path is a new folder in the same directory. 10 seconds is just way too long when Windows can normally change a folder name in a split second.
I found this document that includes a snippet of the kernel call to do the Move using Windows API. It's runs just as fast as a normal rename action in Windows Explorer and is a perfect solution for large files.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-13-2015 06:04 AM - edited 10-13-2015 06:07 AM
Hmmm, I'm pretty sure LabVIEW is internally also using the MoveFile() Windows API in the File Move node.It at least used to do that in the past.
Maybe they changed something in Explorer in newer versions but it used to call the horrible SHFileOperation API which internally used eventually the Windows APIs too.
10-13-2015 07:17 AM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'