Perhaps this will help --
(defun MakeDWL ( / _stripext _stripfolder _filebase _datetime filename filehandle )
(defun _stripext ( filename / i j )
(repeat (setq i (strlen filename))
(if (null j)
(if (eq 46 (ascii (substr filename i)))
(setq j i)
)
)
(setq i (1- i))
)
(if j
(substr filename 1 (1- j))
filename
)
)
(defun _stripfolder ( filename / i j )
(repeat (setq i (strlen filename))
(if (null j)
(if (member (ascii (substr filename i)) '(92 47))
(setq j i)
)
)
(setq i (1- i))
)
(if j
(substr filename (1+ j))
filename
)
)
(defun _filebase ( filename / i j )
(if (eq 'subr (type vl-filename-base))
(vl-filename-base filename)
(_stripfolder (_stripext filename))
)
)
(defun _datetime ( a b c d e f delimeter / raw )
(strcat
(substr (setq raw (rtos (getvar "cdate") 2 15)) a b)
delimeter
(substr raw c d)
delimeter
(substr raw e f)
)
)
(cond
(
(and
(eq 1 (getvar "writestat"))
(setq filehandle
(open
(setq filename
(strcat
(getvar "dwgprefix")
(_filebase (getvar "dwgname"))
".dwl"
)
)
"w"
)
)
)
(princ (strcat (getvar "loginname") "\n") filehandle)
(princ (strcat (getenv "computername") "\n") filehandle)
(princ
(strcat
(_datetime 1 4 5 2 7 2 "/") ;; date
" "
(_datetime 10 2 12 2 14 2 ":") ;; time
)
fileHandle
)
(close fileHandle)
)
)
(princ)
)
Add a ref to your s::startup function, i.e.
(defun s::startup ( )
;; ...
(MakeDwl)
;; ...
)
It will write out data to the dwl file like so (same as whohas.arx) --
CottageCGirl
PC90210
2005/05/26 13:27:38
While you could add reactor code to delete the dwl file on close / exit there's nothing wrong with leaving the dwl files on the server, to witt, they identify who edited the drawing last.
/HTHAL