cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SFTP patch for touch

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 20 Mar 2008 12:26:06 -0700

On Thu, Mar 20, 2008 at 04:01:44PM +0100, Vincent Le Normand wrote:
> I performed a diff -u from my /lib directory against original (7.18.0) lib
> directory. I also changed the behaviour to match standard unix touch
> behaviour (access date and modification date are changed.

The patch looks good to me, except this part:

> + else if(curl_strnequal(sshc->quote_item->data, "touch", 5)) {
> + sshc->quote_attrs.mtime = curl_getdate(sshc->quote_path1, NULL);
> + sshc->quote_attrs.atime = sshc->quote_attrs.mtime;
> + if(sshc->quote_attrs.mtime == 0) {

curl_getdate returns -1 in case of error, not 0. 0 is a valid time.

> I am not familiar with manpages (except reading them), but i also thing that
> a proper section for quote commands (particularly SFTP quote commands) would
> be a good thing. I've tried to start something with this patch. But i may be
> totally wrong.

I agree--an excellent idea!

> +.SH SFTP QUOTE COMMANDS
> +SFTP is a binary protocol. libcurl does interpret commands you may provide
> +by using \fICURLOPT_QUOTE\fP \fICURLOPT_POSTQUOTE\fP and \fICURLOPT_PREQUOTE\fP
> +before sending them to the FTP server. The following list of quote commands

This should say SFTP server, though.

> +are supported:
> +
> +.IP chgrp group file
> +The chgrp command set the group ID of the file named by the file operand to the
> +group ID specified by the group operand. The group operand must be a numeric
> +group ID.

You might as well reference chgrp(1) here like chmod.

> +.IP chmod mode file
> +The chmod command modifies the file mode bits of the file as specified named by
> +the file operand.
> +See chmod(1).
> +
> +.IP ln
> +See symlink
> +
> +.IP symlink source_file target_file
> +The ln and symlink commands create symlinks at the source_file location. This

Maybe "to the source_file".

> +symlink point to the target_file location.
> +
> +.IP mkdir directory_name
> +The mkdir utility creates the directories named by the directory_name operand.

This should be "directory" singular.

> +
> +.IP pwd
> +The pwd command returns the absolute pathname of the current working directory.
> +
> +.IP rename source target
> +The rename command renames the file named by the source operand to the
> +destination path named by the target operand.
> +
> +.IP rm file
> +The rm utility command to remove the non-directory type files specified by the
> +file operand.

That sentence doesn't quite make sense. How about:

  The rm command removes the non-directory type file specified by the
  file operand.

> +
> +.IP rmdir directory
> +The rmdir utility removes the directory entry specified by the directory operand,

Should say "command" instead of utility.

> +provided it is empty.
> +
> +.IP touch time file
> +The touch utility sets the modification access times of files specified by the

Singular "time" and "the file".

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-03-20