Hi everybody !
I'm trying to read some file attributes (such as the modification date/time in seconds) of a file located on a remote server, and I assume I could do that using the libURLftpCommand function (but may be there is a simpler way...).
However I'm not familiar at all with the ftp commands, although I've tried to read the RFC 959 document, particularly section 4.1.3, as recommended in the LiveCode Dictionary.
My questions are:
1. What is the exact syntax of ftp commands to be sent in order to:
a) specify a directory on the remote server (CWD command ?),
b) obtain an information similar to "the detailed files" (LIST command ?)
2. Is there a way to retrieve this information only for one file by giving also its file name ?
Thanks for any assistance...
How to use ftp commands ?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: How to use ftp commands ?
Hey there sailor 
In the dictionary look up just plain old ftp:
Simon

In the dictionary look up just plain old ftp:
From that it seems that if you specify a filename then it will download it not just show you it's attributes.put "jim" into userName
put "jsmith@example.org" into userPassword
put "ftp://" & userName & ":" & URLEncode(userPassword) \
& "@ftp.example.com/title.txt" into fileURLToGet
get URL fileURLToGet
Here are some examples of valid ftp URLs:
ftp://ftp.example.org/directory/ -- list of files and folders in a directory
ftp://ftp.example.org/directory/file.exe -- a file on the server
ftp://user:password@ftp.example.org/myfile -- a file accessed by a password
ftp://ftp.example.com:3992/somefile -- using a nonstandard FTP port
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 49
- Joined: Sun Jan 24, 2010 10:34 pm
Re: How to use ftp commands ?
Thank you very much Simon !
I appreciate finding an answer on returning from a nice sailing…
The "ftp URL ftp://ftp.example.org/directory/" syntax works fine, at least to get the file modification date.
The result is not as complete as what is obtained with "the detailed files" about local files, but it's perfect for the modification date, which was my initial goal.
Many thanks !
I appreciate finding an answer on returning from a nice sailing…
The "ftp URL ftp://ftp.example.org/directory/" syntax works fine, at least to get the file modification date.
The result is not as complete as what is obtained with "the detailed files" about local files, but it's perfect for the modification date, which was my initial goal.
Many thanks !