Need subroutine to return full file path name

Need subroutine to return full file path name

Post by Steve Rosem » Wed, 21 Feb 1990 06:09:57

        I need to find out the full path name of a file from a full or partial
name entered by the user, so other users can access the file (assuming
proper permissions, etc.)

        For example, a user currently in /u/mydir/sub:

        input:  test.c                  output: /u/mydir/sub/test.c
        input:  /u/frog                 output: /u/frog
        input:  ../filename             output: /u/mydir/filename

        SUN OS has a routine realpath(3), but that doesn't do very much good
with AIX 2.2.1.  I have looked through the AIX OS Tech Ref manual, but can't
find anything.  If anyone has a lead, or a routine, I would appreciate not
having to write it myself.


Steve Roseman
Lehigh University Computing Center


1. Extracting full path name from ~user/path

Environment SunOS 4.1.1 on Sun Sparcstation

Is there a system function from which I can get a full path name from a ~user/pathname ?
  eg.     full_path = some_function("~user/pathname");
           /* returns a pointer to a char string /home/user/pathname */

Please email your responses.  I am not a regular reader of this newsgroup.
Thank you.
Rupen Sheth

2550 Beckleymeade Ave. MS 4004                   Phone: (214) 708-3344
Dallas, TX 75237                                   FAX: (214) 708-4827

2. changing default shells in NIS

3. Obtaining the full path name of a file?

4. screen changed : no more graphic login, help

5. Get full path name for a file

6. Xine does not play DVDs

7. how to extract path/file name upto the mzximum of two levels from the file name?

8. Mime64 encoding and the mail command

9. need full path of input file ($1)

10. How to expand paths in $PATH like "~/bin" to full path?

11. Need to view full name of process name disregarding brackets

12. how to get process' full path name + executable

13. Detrmining application's full path and name