Rebex
Products Downloads Buy Support Contact
Show / Hide Table of Contents

Ftp.GetNameListAsync Method

Namespace: Rebex.Net
Assembly: Rebex.Ftp.dll (version 7.0.9147)

GetNameListAsync(String, Object)

Begins asynchronous GetNameList operation. Retrieves the list of names.

Declaration
public Task<string[]> GetNameListAsync(string arguments, object state = null)
Parameters
Type Name Description
String arguments

Arguments for the NLST command.

Object state

An optional user-provided object that identifies this particular asynchronous operation.

Returns
Type Description
Task<String[]>

An array of names.

Implements
IFtp.GetNameListAsync(String, Object)
Remarks

Represents FTP NLST command.

Actual behavior of NLST command varies from server to server, because the RFC is not clear in explaining what it should do. Some servers return the names of both files and directories, others return files only or even report error if the current directory is empty. Using GetList is a better choice in most cases.

Caution: The meaning of the arguments argument is not defined by RFC and varies from server to server. Some servers interpret it as parameters to ls command, some as a filename, some ignore it and some report an error. Calling this method with arguments other than null is not recommended and will make your code incompatible with many FTP servers.

GetNameListAsync(Object)

Begins asynchronous GetNameList operation. Retrieves the list of names in the current server directory.

Declaration
public Task<string[]> GetNameListAsync(object state = null)
Parameters
Type Name Description
Object state

An optional user-provided object that identifies this particular asynchronous operation.

Returns
Type Description
Task<String[]>

An array of names.

Implements
IFtp.GetNameListAsync(Object)
Remarks

Represents FTP NLST command.

Actual behaviour of NLST command varies from server to server, because the RFC is not clear in explaining what it should do. Some servers return the names of both files and directories, others return files only or even report error if the current directory is empty. Using GetList is a better choice in most cases.

In This Article
  • GetNameListAsync(String, Object)
  • GetNameListAsync(Object)
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies