🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #2201

Re: Web2c and subdirectory searching

#2201
From: Timothy Murphy
Date: Fri, 14 Aug 1992 14:28
60 lines
2047 bytes
tfb@aisb.ed.ac.uk (Tim Bradshaw) writes:

>What I did find was that the code is incredibly bright about working
>out if a directory *has* subdirs -- it counts the links and assumes
>that if there are only 2 then it hasn't.  I don't see how it could do
>significantly better than it does, unless there is something obvious
>I'm missing.

As a temporary hack I've done the following.
I created a directory CACHEDIR,
and put it at the start of TEXINPUTS.
Then any input file requested in TARGETDIR is linked
to a file with the same name in CACHEDIR.

============= in lib/site.h =============

#define TEXINPUTS  ".:/usr/local/lib/tex/tmpinputs:/usr/local/lib/tex/inputs//"

=========================================

=========== in lib/ourpaths.c ===========

!#define TARGETDIR "/usr/local/lib/tex/inputs"
!#define CACHEDIR "/usr/local/lib/tex/tmpinputs"

...

boolean
testreadaccess (name, path_index)
  char *name;
  int path_index;
{
  string found;  
  
  make_c_string (&name);

  found = find_path_filename (name, path_dirs[path_index]);
  if (found != NULL)
! {
!   if (strncmp(found, TARGETDIR, strlen(TARGETDIR)) == 0) {
!     char cmd[256];
!     sprintf(cmd, "ln %s %s/%s", found, CACHEDIR, name);
!     system(cmd);
!   }
    strcpy (name, found);
! }
  
  make_pascal_string (&name);
  
  return found != NULL;
}
=========================================

Just an idea ...

-- 
Timothy Murphy  
e-mail: tim@maths.tcd.ie
tel: +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
Technical Details
Message-ID: <1992Aug14.142851.24428@maths.tcd.ie>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!ieunet!tcdcs!maths.tcd.ie!tim
References: <TFB.92Aug13021349@eagle.aisb.ed.ac.uk> <1992Aug13.020719.1100@maths.tcd.ie> <TFB.92Aug13084631@helium.aisb.ed.ac.uk>

Show Full Headers
Complete Article Headers
Newsgroups: comp.text.tex
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!ieunet!tcdcs!maths.tcd.ie!tim
From: tim@maths.tcd.ie (Timothy Murphy)
Subject: Re: Web2c and subdirectory searching
Message-ID: <1992Aug14.142851.24428@maths.tcd.ie>
Organization: Dept. of Maths, Trinity College, Dublin, Ireland.
References: <TFB.92Aug13021349@eagle.aisb.ed.ac.uk>  <1992Aug13.020719.1100@maths.tcd.ie> <TFB.92Aug13084631@helium.aisb.ed.ac.uk>
Date: Fri, 14 Aug 1992 14:28:51 GMT
Lines: 60