From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting set of files with the ftp-VI's

Hi

I need to now how I can delete a direktory including the files in it, with the ftp-VI's from the internet connectivity toolset.
I have used the FTP[dele].VI and the FTP[RMD]to delete single files and direktory.
I have been told that the UNIX command "rm -rf direktoryname" should delete the specified direktory and the contens of files.
I have tried to use this comman with the FTP Command.vi, but it didn't work.
Can anybody help me ?
0 Kudos
Message 1 of 2
(2,708 Views)
Hi,

I may not be correct but directories that still contain files or subdirectories typically cannot be deleted using FTP software. You must first delete the files located in the directory you want to remove. As far as the Internet Toolkit goes, I dont really know but I know that clients like WS-FTP and the new FTP.NET component give you that option.

Looping through the folders and files seems to be the way to do it with labview. You could probably use this link as a starting point and modify it for FTP commands:
http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B123AE0CBC23111EE034080020E74861&p_node=DZ53008&p_submitted=N&p_rank=&p_answer=&p_source=External

One thing to be aware of is that sometimes the directory will seem to be empty but it really isn't. It has at least one file under it somewhere that begins with a period (.) so that it is hidden or invisible to the regular 'ls' command.
In order to see and delete these hidden files,

1) Get a shell prompt and type:
ls -la /Dir1/Dir2/dirname

where /Dir1/Dir2/dirname is the full path to the directory that you are trying to delete. Doing that will show you all the hidden files inside the directory. You can then delete these hidden files using the standard commands.

Hope this helps
Cyril Bouton
Active LabVIEW Developper
0 Kudos
Message 2 of 2
(2,697 Views)