What type of server do you mean?
If it's a web server, the web server would have to permit directory listings. Then it's usually accomplished by accessing the directory path as an URL (make sure the directory doesn't contain a default document, like index.cfm or default.htm, etc).
So, for example,
would give you a directory listing of
f:\html\
or whatever. But, again, the server must be set to permit it.
If you're talking a box with an FTP server on it, you can call CFFTP like:
Code:
<CFFTP action="LISTDIR" name="qryDirList" directory="f:\html\[URL unfurl="true"]wwwroot\mypath\mydirectory"[/URL] ...>
<CFDUMP var="#qryDirList#">
Otherwise, you'd need to set up an "agent" page on the server B that does a CFDIRECTORY (or equivilent, if it doesn't run ColdFusion). Then the page on server A would do a CFHTTP to request that page, and grab the CFFILE.filecontents that's returned.
Those are the only ways I know to do it... other than through a file share/samba... but then you'd just use CFDIRECTORY like you normally would, and specify the mapped drive/directory as if it were a local path.
-Carl