fsFileDelete

Deletes an FTP server file.

Syntax:

fsFileDelete( client-handle, remote-file )

Parameters:

(s) client-handle: FTPS extender client handle.

(s) remote-file: name of server file to delete.

Returns:

(i)@True(1) if file successfully deleted

The fsFileDelete function removes the file named in the second parameter from the FTP server associated with the client-handle parameter. The function errors if the file is not found on the server.

 

client-handle

FTPS extender client handle obtain by a call to the fsClientInit function.

 

remote-file 

Use this parameter to specify the FTP server file you wish to delete. Include any necessary server path information to the targeted file to insure that the correct file is found and deleted..

Example:
  AddExtender('ilcfs44i.dll',0,'ilcfs64i.dll')
  host = 'test.example.com'
  port = 21
  user = 'demo'
  pswd  = 'password'
  
  ; Create a client
  client = fsClientInit(host, port, user, pswd)
  
  ; Fetch a list of files in the CustData directory
  dir = "\CustData"
  files = fsDirList(client, dir, @fsArray)
  
  ; Delete all the csv files from the director
  ForEach file In files
     If StrLower(FileExtension(file)) == 'csv' 
        fsFileDelete(client, dir:'/':file)
      EndIf
  Next
  
  ; Disconnect and remove
  fsClientDelete(client)
See Also:

fsClientInit, fsFileInfo, fsDirList