jed-users mailing list

[2015 Date Index] [2015 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [jed-users] Dired fails on directory or file names with spaces?


I checked the Posix man page a little later and found that it doesn't
include any of those options which kind of shoots portability in the head.
The problem with the code in dired.sl comes down to the following two lines
at the end of dired_point:

   eol ();
   bskip_chars ("^ \n");

Once the meaning of that sunk in it was pretty obvious how it was going
wrong.  Beyond that there are several other places in the code that make a
similar assumption that the file or directory name is the last thing on the
line and consists of one (or two with extensions) space delimited tokens.
For Unix / Linux it probably needs to do something like start of the 9th
field through the EOL.


On Sun, Apr 26, 2015 at 11:02 AM, Roland Hughes <roland@xxxxxxxxxxxxxxxxxxxx
> wrote:

>  Doesn't the -m do comma delim? OH, it only gives you names though.
>
>
> On 04/26/2015 09:53 AM, Tom Culliton wrote:
>
> I'm running on various flavors of Linux.
>
> The conditional code for different OSes makes reading this code cold a bit
> hairy, but given that info it's now fairly obvious where the issue is. I
> may just be able to tweak the ls options to provide a more unique separator.
>
> I was just writing some shell script the other day where something like
> "find -print0 | grep -zZ | xargs -0" was the key to dealing with similar
> issues. Maybe the -b option to ls to escape the string, or -D which gives
> offsets to the start and end of the names, or -Q to quote the name, ...
>
>
> On Sat, Apr 25, 2015 at 1:38 PM, John E. Davis <jed@xxxxxxxxxxx> wrote:
>
>> Tom Culliton <tom.culliton@xxxxxxxxx> wrote:
>> > I did a little poking around in dired.sl looking for obvious issues but
>> > nothing jumped out at me. Maybe it's an issue with parse_filename, or
>> the
>> > underlying slang functions?
>>
>> No, the slang functions are ok.  The problem is that the dired_point
>> function cannot handle filenames with spaces.  Dired relies upon shell
>> functions such as "ls" on Unix and "dir" on DOS/Windows/VMS systems to
>> produce the directory listing that appears in the *dired* buffer.
>> The precise output of these commands is locale-dependent.
>> The dired_point function assumes that the name of the file is the last
>> whitespace delimited word on the line, which breaks if the filename
>> contains spaces.
>>
>> The solution would be for me to rewrite the code that produces the
>> dired listing so that it does not depend upon "ls" or "dir".
>>
>> What OS are you using?
>>
>> Thanks,
>> --John
>> _______________________________________________
>> For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
>>
>>
>
> --
> Roland Hughes, President
> Logikal Solutions
> (630)-205-1593  (cell)http://www.theminimumyouneedtoknow.comhttp://www.infiniteexposure.nethttp://www.johnsmith-book.com
>
>

[2015 date index] [2015 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]