Loading ...
Sorry, an error occurred while loading the content.

Re: editing via ftp

Expand Messages
  • Martin Karlsson
    [I m sorry about some overlong lines.] ... $ mkdir /tmp/mine $ chmod 700 /tmp/mine $ fetch -o /tmp/mine/4 ftp://ftp.burken.nu/public_html/index.html fetch:
    Message 1 of 13 , Jul 1, 2003
    • 0 Attachment
      [I'm sorry about some overlong lines.]

      * Bram Moolenaar <Bram@...> [2003-07-01 11.00 +0200]:
      >
      > Martin Karlsson wrote:
      >
      > > I'm in the same situation: FreeBSD 4.8-release, vim-6.2.14, and
      > > trying to edit over ftp gives me an empty file locally.
      > >
      > > This is the message I get when trying
      > > "e ftp://ftp.burken.nu/public_html/index.html"
      > >
      > >
      > > !fetch -o /tmp/v67411/4 ftp://ftp.burken.nu/public_html/index.html
      > > E484: Can't open file /tmp/v67411/4
      >
      > What happens if you try running that fetch command in a terminal?
      > Adjust the output file name to use a directory that exists.
      >
      > Hmm, Vim creates a temp directory only writable by the user. Does fetch
      > run under another user perhaps? Try this:
      >
      > mkdir /tmp/mine
      > chmod 700 /tmp/mine
      > fetch -o /tmp/mine/4 ftp://ftp.burken.nu/public_html/index.html

      $ mkdir /tmp/mine
      $ chmod 700 /tmp/mine
      $ fetch -o /tmp/mine/4 ftp://ftp.burken.nu/public_html/index.html
      fetch: ftp://ftp.burken.nu/public_html/index.html: File unavailable (e.g., file not found, no access)


      $ ftp ftp.burken.nu
      Connected to ftp.burken.nu.
      220 ftp FTP server (Version 6.00LS) ready.
      Name (ftp.burken.nu:martink):
      331 Password required for martink.
      Password:
      230 User martink logged in, access restrictions apply.
      Remote system type is UNIX.
      Using binary mode to transfer files.
      ftp> ls public_html
      150 Opening ASCII mode data connection for '/bin/ls'.
      total 20
      drwxr-xr-x 2 1727 1727 512 Jun 16 22:13 files
      -rw-r--r-- 1 1727 1727 921 Jul 1 01:33 index.html <-- it's there
      drwxr-xr-x 2 1727 1727 512 Jun 7 11:37 martink
      -rw-r--r-- 1 1727 1727 20 Feb 23 21:47 phpinfo.php
      -rw-r--r-- 1 1727 1727 455 Feb 12 00:44 search.php
      -rw-r--r-- 1 1727 1727 10074 Feb 21 09:34 vi-ref.html
      226 Transfer complete.


      Could it be that the username and password are not passed by vim
      in this (below) form to fetch(1)?
      Because this (on the command line) works:

      $ fetch -vv -o /tmp/mine/4 ftp://username:password@.../public_html/index.html
      ^^^^^^^^^^^^^^^^^
      ^^^^^^^^^^^^^^^^^
      ---> ftp.burken.nu:21
      looking up ftp.burken.nu
      connecting to ftp.burken.nu:21
      <<< 220 ftp FTP server (Version 6.00LS) ready.
      >>> USER martink
      <<< 331 Password required for martink.
      >>> PASS mypassword
      <<< 230 User martink logged in, access restrictions apply.
      >>> TYPE I
      <<< 200 Type set to I.
      >>> CWD /public_html
      <<< 250 CWD command successful.
      >>> SIZE index.html
      <<< 213 921
      size: [921]
      >>> MDTM index.html
      <<< 213 20030701013340
      last modified: [2003-07-01 01:33:40]
      setting passive mode
      >>> PASV
      <<< 227 Entering Passive Mode (194,236,124,37,228,255)
      opening data connection
      initiating transfer
      >>> RETR index.html
      <<< 150 Opening BINARY mode data connection for 'index.html' (921 bytes).
      remote size / mtime: 921 / 1057023220
      Receiving /tmp/mine/4 (921 bytes): 100%
      921 bytes transferred in 0.0 seconds (35.61 kBps)
      Waiting for final status
      <<< 226 Transfer complete.


      Thanks for helping with this,
      --
      Martin Karlsson
    • Bram Moolenaar
      ... Does this mean you have a login name and password in your ~/.netrc file? Hmm, perhaps the fetch command only does anonymous ftp access when there is no
      Message 2 of 13 , Jul 1, 2003
      • 0 Attachment
        Martin Karlsson wrote:

        > > > I'm in the same situation: FreeBSD 4.8-release, vim-6.2.14, and
        > > > trying to edit over ftp gives me an empty file locally.
        > > >
        > > > This is the message I get when trying
        > > > "e ftp://ftp.burken.nu/public_html/index.html"
        > > >
        > > >
        > > > !fetch -o /tmp/v67411/4 ftp://ftp.burken.nu/public_html/index.html
        > > > E484: Can't open file /tmp/v67411/4
        > >
        > > What happens if you try running that fetch command in a terminal?
        > > Adjust the output file name to use a directory that exists.
        > >
        > > Hmm, Vim creates a temp directory only writable by the user. Does fetch
        > > run under another user perhaps? Try this:
        > >
        > > mkdir /tmp/mine
        > > chmod 700 /tmp/mine
        > > fetch -o /tmp/mine/4 ftp://ftp.burken.nu/public_html/index.html
        >
        > $ mkdir /tmp/mine
        > $ chmod 700 /tmp/mine
        > $ fetch -o /tmp/mine/4 ftp://ftp.burken.nu/public_html/index.html
        > fetch: ftp://ftp.burken.nu/public_html/index.html: File unavailable (e.g., file not found, no access)

        Does this mean you have a login name and password in your ~/.netrc
        file? Hmm, perhaps the fetch command only does anonymous ftp access
        when there is no login/password in the URL. I can't find a clear remark
        about that in the man page.

        The obvious solution would be not to use "fetch" for ftp. Charles, can
        you agree with that?

        --
        MAN: You don't frighten us, English pig-dog! Go and boil your bottoms,
        son of a silly person. I blow my nose on you, so-called Arthur-king,
        you and your silly English K...kaniggets.
        He puts hands to his ears and blows a raspberry.
        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
      • Martin Karlsson
        * Bram Moolenaar [2003-07-01 19.34 +0200]: [...snip...] ... I ve tested *with* as well as *without* a ~/.netrc (containing machine, login,
        Message 3 of 13 , Jul 1, 2003
        • 0 Attachment
          * Bram Moolenaar <Bram@...> [2003-07-01 19.34 +0200]:

          [...snip...]

          > Does this mean you have a login name and password in your ~/.netrc
          > file?

          I've tested *with* as well as *without* a ~/.netrc (containing
          machine, login, and password) with the same result; the only
          invocation of fetch(1) that seems to work for me is:

          $ fetch -o /tmp/mine/4 ftp://login:password@.../public_html/index.html
          ^^^^^^^^^^^^^^
          Best regards,
          --
          Martin Karlsson
        • David Rock
          ... Try double slashing ALL slashes: e ftp://ftp.burken.nu//public_html//index.html -- David Rock david@graniteweb.com
          Message 4 of 13 , Jul 1, 2003
          • 0 Attachment
            * Bram Moolenaar <Bram@...> [2003-07-01 11:00]:
            >
            > Martin Karlsson wrote:
            >
            > > I'm in the same situation: FreeBSD 4.8-release, vim-6.2.14, and
            > > trying to edit over ftp gives me an empty file locally.
            > >
            > > This is the message I get when trying
            > > "e ftp://ftp.burken.nu/public_html/index.html"

            Try double slashing ALL slashes:
            e ftp://ftp.burken.nu//public_html//index.html

            --
            David Rock
            david@...
          • Martin Karlsson
            ... It doesn t seem to work for me. :( I still get an empty buffer in vim. Thanks all the same, I appreciate your input. ... -- Martin Karlsson
            Message 5 of 13 , Jul 2, 2003
            • 0 Attachment
              * David Rock <david@...> [2003-07-01 23.11 -0500]:
              > * Bram Moolenaar <Bram@...> [2003-07-01 11:00]:
              > >
              > > Martin Karlsson wrote:
              > >
              > > > I'm in the same situation: FreeBSD 4.8-release, vim-6.2.14, and
              > > > trying to edit over ftp gives me an empty file locally.
              > > >
              > > > This is the message I get when trying
              > > > "e ftp://ftp.burken.nu/public_html/index.html"
              >
              > Try double slashing ALL slashes:
              > e ftp://ftp.burken.nu//public_html//index.html

              It doesn't seem to work for me. :( I still get an empty buffer in
              vim. Thanks all the same, I appreciate your input.

              > --
              > David Rock
              > david@...

              --
              Martin Karlsson
            • David Rock
              ... I came across this when using scp to edit remote files. Any chance you have that as an option for this? Maybe that would work better. -- David Rock
              Message 6 of 13 , Jul 2, 2003
              • 0 Attachment
                * Martin Karlsson <mk-freebsd@...> [2003-07-02 18:50]:
                >
                > * David Rock <david@...> [2003-07-01 23.11 -0500]:
                > > * Bram Moolenaar <Bram@...> [2003-07-01 11:00]:
                > > >
                > > > Martin Karlsson wrote:
                > > >
                > > > > I'm in the same situation: FreeBSD 4.8-release, vim-6.2.14, and
                > > > > trying to edit over ftp gives me an empty file locally.
                > > > >
                > > > > This is the message I get when trying
                > > > > "e ftp://ftp.burken.nu/public_html/index.html"
                > >
                > > Try double slashing ALL slashes:
                > > e ftp://ftp.burken.nu//public_html//index.html
                >
                > It doesn't seem to work for me. :( I still get an empty buffer in
                > vim. Thanks all the same, I appreciate your input.

                I came across this when using scp to edit remote files. Any chance you
                have that as an option for this? Maybe that would work better.

                --
                David Rock
                david@...
              • Martin Karlsson
                ... Unfortunately scp is not an option in this case. ... Regards, -- Martin Karlsson
                Message 7 of 13 , Jul 2, 2003
                • 0 Attachment
                  * David Rock <david@...> [2003-07-02 23.20 -0500]:
                  > * Martin Karlsson <mk-freebsd@...> [2003-07-02 18:50]:
                  > >
                  > > * David Rock <david@...> [2003-07-01 23.11 -0500]:
                  > > >
                  > > > Try double slashing ALL slashes:
                  > > > e ftp://ftp.burken.nu//public_html//index.html
                  > >
                  > > It doesn't seem to work for me. :( I still get an empty buffer in
                  > > vim. Thanks all the same, I appreciate your input.
                  >
                  > I came across this when using scp to edit remote files. Any chance you
                  > have that as an option for this? Maybe that would work better.

                  Unfortunately scp is not an option in this case.

                  > --
                  > David Rock
                  > david@...

                  Regards,
                  --
                  Martin Karlsson
                • Shaun Branden
                  ... Thanks for the suggestion, the url actually works because adding a character will clobber the file. It is just the local buffer that is empty. ...
                  Message 8 of 13 , Jul 3, 2003
                  • 0 Attachment
                    On Thu, Jul 03, 2003 at 08:00:05AM +0200, Martin Karlsson wrote:

                    > > > > Try double slashing ALL slashes:
                    > > > > e ftp://ftp.burken.nu//public_html//index.html

                    Thanks for the suggestion, the url actually works because adding a
                    character will clobber the file. It is just the local buffer that is
                    empty.

                    > > > It doesn't seem to work for me. :( I still get an empty buffer in
                    > > > vim. Thanks all the same, I appreciate your input.
                    > >
                    > > I came across this when using scp to edit remote files. Any chance you
                    > > have that as an option for this? Maybe that would work better.
                    >
                    > Unfortunately scp is not an option in this case.

                    Likewise. I can only use ftp, but it is not a big deal as I can edit in
                    vim and ftp the file up.

                    The main problem is that I can't show off this cool feature :)

                    shaun
                    --
                    Shaun Branden; email: shaun@...; icq: 10469563
                    Computerbank South Australia: sa.computerbank.org.au
                    Computerbank gives away computer systems created from
                    donated hardware and opensource software.
                  Your message has been successfully submitted and would be delivered to recipients shortly.