<doc>
  <legacy_id>1882</legacy_id>
  <name>libURLSetFTPListCommand</name>
  <type>command</type>
  <syntax>
    <example>libURLSetFTPListCommand {"LIST" | "NLST"}</example>
  </syntax>
  <library>Internet library</library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Networks &amp; Communication</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <keyword tag="ftp">ftp Keyword</keyword>
    <function tag="libURLftpCommand">libURLftpCommand Function</function>
  </references>
  <history>
    <introduced version="2.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
    <network/>
  </security>
  <summary>Switches between sending LIST or NLST formats when listing the contents of an <keyword tag="ftp">FTP</keyword> <property tag="defaultFolder">directory</property>.</summary>
  <examples>
    <example>libURLSetFTPListCommand "NLST"</example>
    <example>libURLSetFTPListCommand (the listCommand of this card)</example>
  </examples>
  <description>
    <p>Use the <b>libURLSetFTPListCommand</b> <glossary tag="command">command</glossary> to get a simple list of <function tag="files">files</function> in an <keyword tag="ftp">FTP</keyword> <property tag="defaultFolder">directory</property>.</p><p/><p><b>Comments:</b></p><p>A URL that ends with a slash (/) designates a directory (rather than a file). An <b>ftp</b> <keyword tag="URL">URL</keyword> to a <property tag="defaultFolder">directory</property> evaluates to a listing of the <glossary tag="folder">directory's</glossary> contents. The format of a directory listing depends on which FTP command LiveCode sends to the <keyword tag="ftp">FTP</keyword> <glossary tag="server">server</glossary>. You specify which command to use with the <b>libURLSetFTPListCommand</b> <glossary tag="command">command</glossary>.</p><p/><p>If you specify<code> LIST</code>, directory listings are returned in the same format as the Unix "ls" command and include information such as permissions, owner, size, and last modification date as well as the name of each file or subdirectory. Use this format if you need the additional information about each item in the directory.</p><p/><p>If you specify<code> NLST</code>, directory listings consists of a list of names of files and subdirectories, one per line, without the additional information provided in a<code> LIST </code>listing. Use this format if you need a simple list of files and don't want to parse the more complex<code> LIST </code>listing for the file names.</p><p/><p>The list command is set to<code> LIST </code>when the application starts up.</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> <keyword tag="ftp">FTP</keyword> <glossary tag="server">servers</glossary> are not uniform in their response to a request for a directory listing. Some <glossary tag="server">servers</glossary> may format directory listings differently from these descriptions. These are the most common formats, but they are not universal.</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> The <b>libURLSetFTPListCommand</b> <glossary tag="command">command</glossary> is part of the <glossary tag="Internet library">Internet library</glossary>. To ensure that the <glossary tag="command">command</glossary> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure "Internet Library" is selected in the list of script libraries.</p><p/><p><code/><b>Note:</b><code/> When included in a <glossary tag="standalone application">standalone application</glossary>, the <glossary tag="Internet library">Internet library</glossary> is implemented as a hidden <command tag="group">group</command> and made available when the <command tag="group">group</command> receives its first <message tag="openBackground">openBackground</message> message. During the first part of the <glossary tag="application">application's</glossary> startup process, before this <keyword tag="message box">message</keyword> is sent, the <b>libURLSetFTPListCommand</b> <glossary tag="command">command</glossary> is not yet available. This may affect attempts to use this <glossary tag="command">command</glossary> in <message tag="startup">startup</message>, <message tag="preOpenStack">preOpenStack</message>, <message tag="openStack">openStack</message>, or <message tag="preOpenCard">preOpenCard</message> <glossary tag="handler">handlers</glossary> in the <glossary tag="main stack">main stack</glossary>. Once the <glossary tag="application">application</glossary> has finished starting up, the <command tag="start using">library</command> is available and the <b>libURLSetFTPListCommand</b> <glossary tag="command">command</glossary> can be used in any <glossary tag="handler">handler</glossary>.</p>
  </description>
</doc>