File: getuid.x

package info (click to toggle)
iraf 2.18.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,000 kB
  • sloc: ansic: 115,890; fortran: 74,576; lisp: 18,888; yacc: 5,642; sh: 961; lex: 596; makefile: 509; asm: 159; csh: 54; xml: 33; sed: 4
file content (24 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

# GETUID -- Get user id, i.e., return the name of the user.  We do this by
# creating a temporary file and calling fowner to get the name of the file
# owner.

procedure getuid (user_name, maxch)

char	user_name[ARB]
int	maxch
pointer	sp, tempfile
int	open()

begin
	call smark (sp)
	call salloc (tempfile, SZ_FNAME, TY_CHAR)

	call mktemp ("tmp$uid", Memc[tempfile], SZ_FNAME)
	call close (open (Memc[tempfile], NEW_FILE, BINARY_FILE))
	call fowner (Memc[tempfile], user_name, maxch)
	call delete (Memc[tempfile])

	call sfree (sp)
end