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

Re: Vim thinks a directory is an illegal filename on Windows

Expand Messages
  • Bram Moolenaar
    ... Hey, Unix and MS-Windows ARE different. What happens here is that on Unix the shell does the wildcard expansion, while on MS-Windows Vim has to do it by
    Message 1 of 6 , Apr 28, 2006
      William S Fulton wrote:

      > >>>run: gvim .
      > >>>on Windows at bottom it will say, eg: "C:\" Illegal file name
      > >>>on Solaris and Linux at the bottom it will say, eg: . is a directory
      > >>>
      > >>>The Unix message is less confusing. Can this for Windows versions as
      > >>>it still occurs in vim7.0f? Same message appears when doing
      > >>>:new .
      > >>I haven't found any way to avoid these messages with netrw, so it sounds
      > >>like an issue for Bram M.
      > >
      > > This is a valid message. At the moment it's given Vim doesn't know yet
      > > (for sure) that some autocommand will kick in to handle it.
      > >
      > > You also get the message on Unix if you do ":e dir/".
      > >
      > There is also some inconsistency going on here.
      >
      > On windows:
      > gvim C:\WINDOWS
      > gives: "C:\WINDOWS\" illegal file name
      >
      > On Linux:
      > gvim /usr
      > gives: /usr is a directory
      > but
      > gvim /usr/
      > gives "/usr/" illegal filename
      >
      > And unfortunately bash command completion results in /usr/ rather than
      > /usr.
      >
      > From a user's point of view it just doesn't seem right if one is using
      > the explorer with a directory list showing and then selecting a
      > directory, the illegal filename message appears. One part of the program
      > knows the directory is a directory and another part thinks it is a bad
      > file :(

      Hey, Unix and MS-Windows ARE different.

      What happens here is that on Unix the shell does the wildcard expansion,
      while on MS-Windows Vim has to do it by itself. The rules for wildcard
      expansion are complicated, it's not strange that the results differ.
      Vim happens to add a slash to a directory name, for various reasons.

      --
      If an elephant is left tied to a parking meter, the parking fee has to be paid
      just as it would for a vehicle.
      [real standing law in Florida, United States of America]

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
    Your message has been successfully submitted and would be delivered to recipients shortly.