Newsgroups: comp.unix.questions Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Subject: Re: getting home directories Message-ID: <1991Apr19.102640.20039@athena.mit.edu> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology References: <1991Apr16.155130.2708@jsp.umontreal.ca> Date: Fri, 19 Apr 91 10:26:40 GMT Lines: 24 In article <1991Apr16.155130.2708@jsp.umontreal.ca>, gaumondp@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@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710