loserboy Posted January 16, 2009 Report Share Posted January 16, 2009 excuse me if this is in the wrong section... i'm working on a vi that deletes folders/files on windows xp. when i delete something using labviews provided "delete.vi" it seems to remove the inode number of that folder/file, which means it is gone forever. is there a better method that would allow me to send it to the trash can? sorry for linux inode reference, i'm sure windows made up some super uncool name for the same thing, but i don't know it. Quote Link to comment
Aristos Queue Posted January 17, 2009 Report Share Posted January 17, 2009 I asked your question of the person who developed the File I/O functions for LabVIEW. The answer: "Unfortunately there isn't any built in way to do that. The suggestion he already got (to use system exec.vi) is the easiest way I know of." Quote Link to comment
TobyD Posted January 17, 2009 Report Share Posted January 17, 2009 QUOTE (loserboy @ Jan 15 2009, 02:17 PM) when i delete something using labviews provided "delete.vi" it seems to remove the inode number of that folder/file, which means it is gone forever. Apparently there used to be a "G Toolbox" that contained a vi called "Delete Plus.vi" that had the option to delete to the recycle bin. Does anyone have this vi/toolbox? Was it released under a license that allows it to be given away? Quote Link to comment
jcarmody Posted January 17, 2009 Report Share Posted January 17, 2009 This deletes files but doesn't send them to the Recycle Bin. Any ideas of how to get them there? I'm thinking .NET, but I've never dot-netted anything. Quote Link to comment
TobyD Posted January 17, 2009 Report Share Posted January 17, 2009 QUOTE (jcarmody @ Jan 16 2009, 11:36 AM) This deletes files but doesn't send them to the Recycle Bin. Any ideas of how to get them there? I'm thinking .NET, but I've never dot-netted anything. http://lavag.org/old_files/monthly_01_2009/post-7534-1232134442.png' target="_blank"> You could call SHFileOperation from shell32.dll with the FOF_ALLOWUNDO flag set, but it wants a custom data structure type as an argument so it would not be a trivial task. Quote Link to comment
jzoller Posted January 17, 2009 Report Share Posted January 17, 2009 NTFS copied many characteristics of *nix systems of its time, including the concept and name of inodes. Side note: SHFileOperation notes (http://msdn.microsoft.com/en-us/library/bb762164(VS.85).aspx) that it was replaced in Vista by the IFileOperation interface (http://msdn.microsoft.com/en-us/library/bb775771(VS.85).aspx)... in the unlikely case that anyone is using Vista. Joe Z. Quote Link to comment
Popular Post jcarmody Posted January 17, 2009 Popular Post Report Share Posted January 17, 2009 I've managed this. It deleted 100 files in only a few seconds (and put them in the Recycle Bin). 7 Quote Link to comment
mross Posted January 17, 2009 Report Share Posted January 17, 2009 QUOTE (jcarmody @ Jan 16 2009, 04:52 PM) I've managed this. It deleted 100 files in only a few seconds (and put them in the Recycle Bin). http://lavag.org/old_files/monthly_01_2009/post-7534-1232142686.png' target="_blank"> I knew there had to be a better way! Thanks. Quote Link to comment
TobyD Posted January 17, 2009 Report Share Posted January 17, 2009 QUOTE (jcarmody @ Jan 16 2009, 01:52 PM) I've managed this... :thumbup: Nice one Quote Link to comment
jcarmody Posted January 17, 2009 Report Share Posted January 17, 2009 QUOTE (jcarmody @ Jan 16 2009, 04:52 PM) I've managed this. Silly me, I didn't wire the error cluster into the Shift Register. Quote Link to comment
loserboy Posted January 20, 2009 Author Report Share Posted January 20, 2009 holy crapper, you guys are friggin awesome!!! i haven't gotten any emails notifying me of responses to this post so i was off following this "SHFILEOPSTRUCTA" and "op.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION;" example i found on digital mars.com. returning here to post my findings, and lo and behold.... you guys were here debating the merits and posting examples of several different methods! :worship: how much more of a "christmas morning" experience can u get! hopefully i won't shoot my eye out. thanks everybody, ALL for the inputs. Quote Link to comment
Jolt Posted October 29, 2009 Report Share Posted October 29, 2009 I've managed this. It deleted 100 files in only a few seconds (and put them in the Recycle Bin). Silly question (it may just be that my brain is slow today): where is the reference to "FileSystem" found? Quote Link to comment
FrankB Posted October 29, 2009 Report Share Posted October 29, 2009 Silly question (it may just be that my brain is slow today): where is the reference to "FileSystem" found? Hello Jolt, the 'reference' on the left should be a dotNET constructor node which could be found in 'Connectivity/.NET' palette. After dropping on the BD one can select the appropriate constructor (have a look at its context menu). Within the upcoming window choose 'Microsoft.VisualBasic (8.0.0.0)', or whatever version will show up there, from 'Assembly' control. Some objects will be listed. Select 'Microsoft.VisualBasic.FileIO / FileSystem' and there you are . Interesting stuff, but hard to find Regards, Frank btw: there are no silly questions, only silly answers 1 Quote Link to comment
Antoine Chalons Posted June 16, 2011 Report Share Posted June 16, 2011 I've just posted posted a feature request on NI LabVIEW Idea Exchange to ask for a native LV way to that, if you're tired of using .NET go and vote for it! http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-quot-place-in-recycle-bin-quot-options-to-quot-Delete-quot/idi-p/1601294 1 Quote Link to comment
geirove Posted October 17, 2012 Report Share Posted October 17, 2012 Hello Jolt, the 'reference' on the left should be a dotNET constructor node which could be found in 'Connectivity/.NET' palette. After dropping on the BD one can select the appropriate constructor (have a look at its context menu). Within the upcoming window choose 'Microsoft.VisualBasic (8.0.0.0)', or whatever version will show up there, from 'Assembly' control. Some objects will be listed. Select 'Microsoft.VisualBasic.FileIO / FileSystem' and there you are . Interesting stuff, but hard to find Regards, Frank btw: there are no silly questions, only silly answers This is awesome! Thanks a lot for your tip and help on this subject. I can't believe that NI after ALL this years haven't come up with support for this! Anway, I now have VI that moves files to the Recycle Bin thanks to you !' geir ove Quote Link to comment
Rolf Kalbermatter Posted November 6, 2012 Report Share Posted November 6, 2012 This is awesome! Thanks a lot for your tip and help on this subject. I can't believe that NI after ALL this years haven't come up with support for this! Anway, I now have VI that moves files to the Recycle Bin thanks to you !' geir ove The most likely reason for this is that the concept of Recycle bin is not very consistent across the different platforms LabVIEW runs on (Windows, Linux, MacOSX) and works quite differently. Also technically the Windows Recycle Bin is in fact a tacked on feature to the actual Windows core, residing in the Windows shell component which is a very chaotic collection of interfaces, both COM and procedural oriented and shows that many people have added functionality over time with VERY different ideas of how to do it. There is no central authority making sure those interfaces are consistent nor interoperable, as every product division seems to have added their own gadget with their own preferred architecture into it. Also these interfaces often chance in incompatible ways between OS versions, with APIs being added, depreciated, changed and even removed at will. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.