Jump to content

Deletion of folders and files


Recommended Posts

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.

Link to post
Share on other sites

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."

Link to post
Share on other sites

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?

Link to post
Share on other sites

QUOTE (jcarmody @ Jan 16 2009, 11:36 AM)

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites
  • 9 months later...

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 wink.gif .

Interesting stuff, but hard to find sad.gif

Regards,

Frank

btw: there are no silly questions, only silly answers yes.gif

  • Like 1
Link to post
Share on other sites
  • 1 year later...

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! :yes:

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-quot-place-in-recycle-bin-quot-options-to-quot-Delete-quot/idi-p/1601294

  • Like 1
Link to post
Share on other sites
  • 1 year later...

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 wink.gif .

Interesting stuff, but hard to find sad.gif

Regards,

Frank

btw: there are no silly questions, only silly answers :yes:

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

Link to post
Share on other sites
  • 3 weeks later...

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.