getting home directories

Jonathan I. Kamens jik at athena.mit.edu
Fri Apr 19 20:26:40 AEST 1991


In article <1991Apr16.155130.2708 at jsp.umontreal.ca>, gaumondp at JSP.UMontreal.CA (Gaumond Pierre) writes:
|>    -  ~/dir/file
|>    -  ~user/dir/file
|> 
|> What tools do I have to interpret the ~ and ~user as home directories?

  There are no standard library functions to do this; you'll have to write
code to do it yourself; it isn't that difficult to write.  Either that, or you
can steal the code from one of the many packages that are available on the net
that have it; for example, I believe rn does ~ expansion.

|> What tools can split path name in single components?

  Strtok, if it exists on your system, will do this.  See the man page.  If it
doesn't exist on your system, there are (I believe) several freely
redistributable versions of it floating around the net, or (once again) you
can steal it from another program that has a freely redistributable version of
it.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.questions mailing list