[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] less -f ?



> so I tried it on an unsuspecting sub directory of my home dir.  AFAIK, 
> the sub directory seems to have survived but I get this
> 
> mkdir test
> lesleyb [at] guano:~> less -f test
> test is a directory
> lesleyb [at] guano:~>   less --force test
> test is a directory
> 

What version of less (less --version) ? I've got (on a work machine):
[6%][fileserver][cjohnson] >less --version
less 378+iso254   (Red Hat)
Copyright (C) 2002 Mark Nudelman

...and this does:

[7%][fileserver][cjohnson] >mkdir mumu
[8%][fileserver][cjohnson] >less mumu
	...[[ dump of directory here as if I'd done an ls ]]...
[9%][fileserver][cjohnson] >less -f mumu
	...[[ dump of directory here as if I'd done an ls ]]...
[10%][fileserver][cjohnson] >

so using -f doesn't seem to affect directories.


> While I haven't a clue what would be a reasonable way for less to 
> display a non-regular file, the man page does say it forces it to be 
> opened.  Pedantically, opening a file is different to displaying it so 
> what state is that directory left in?

To display it, one must open it, and its only opened for reading, so it'll
be left in exactly the same state as it was when it was before it was opened,
though the atime on the inode may have been updated :-)

Chris...

-- 
\ Chris Johnson           \
 \ cej [at] nightwolf.org.uk    ~-----,   
  \ http://cej.nightwolf.org.uk/  ~-----------------------------------, 
   \ Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \____
___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.