Lisp HUG Maillist Archive

My Documents folder

I would like to be able to set a directory specific for each user for printing documents from LWW5.
I thought:

(setf *document_dir* 
      (concatenate 'string
                   (format-pathname (sys:get-folder-path :my-documents))
                   "/"))

within the initialization function of deliver would obtain that folder when a
user starts the application, but this seems not necessarily the case. 

For example, the value of *document_dir* at the time the application was delivered was:
C:\Documents and Settings\Sheldon Ball\
On computers at the Veterans Administration, my "My Documents" folder is:
C:\Documents and Settings\Sheldon Ball\vhamacballsh\My Documents\

The 'vhamacballsh' folder is my user name.

The error message I get is:

Error: An error of type CONDITIONS:FILE-OPERATION-ERROR occured, arguments "
(:OPERATION SYSTEM:MAKE-DIRECTORY :ERNO 5 #P"C:/Documents and Settings/Sheldon Ball/")

How can I correctly set the *document_dir* to 

C:\Documents and Settings\Sheldon Ball\user name\My Documents\

Thanks,
Sheldon

Re: My Documents folder


On Dec 1, 2006, at 4:01 AM, Sheldon Ball wrote:

> I would like to be able to set a directory specific for each user for 
> printing documents from LWW5.
> I thought:
>
> (setf *document_dir* 
>       (concatenate 'string
           ^^^^^^^^^^^    Bad bad bad idea!!!!
>                    (format-pathname (sys:get-folder-path 
> :my-documents))
>                    "/"))
>
> within the initialization function of deliver would obtain that folder 
> when a
> user starts the application, but this seems not necessarily the case. 
>
> For example, the value of *document_dir* at the time the application 
> was delivered was:
> C:\Documents and Settings\Sheldon Ball\
> On computers at the Veterans Administration, my "My Documents" folder 
> is:
> C:\Documents and Settings\Sheldon Ball\vhamacballsh\My Documents\
>
> The 'vhamacballsh' folder is my user name.

	(merge-pathnames "My Documents/" (user-homedir-pathname))

is more kosher and less error prone.  Actually it may be better to do.

	(merge-pathnames (make-pathname :directory (list :relative "My 
Documents")) (user-homedir-pathname))

even better would be to explicitly set the other MAKE-PATHNAME initargs 
to NIL.

Cheers

Marco



Re: My Documents folder

On 12/1/06, Sheldon Ball <s.ball@anvita.info> wrote:
> I would like to be able to set a directory specific for each user for
> printing documents from LWW5.
> I thought:
>
> (setf *document_dir*
>       (concatenate 'string
>                    (format-pathname (sys:get-folder-path :my-documents))
>                    "/"))
>
> within the initialization function of deliver would obtain that folder when
> a
> user starts the application, but this seems not necessarily the case.
>
> For example, the value of *document_dir* at the time the application was
> delivered was:
> C:\Documents and Settings\Sheldon Ball\
> On computers at the Veterans Administration, my "My Documents" folder is:
> C:\Documents and Settings\Sheldon Ball\vhamacballsh\My Documents\
>
> The 'vhamacballsh' folder is my user name.
>
> The error message I get is:
>
> Error: An error of type CONDITIONS:FILE-OPERATION-ERROR occured, arguments "
> (:OPERATION SYSTEM:MAKE-DIRECTORY :ERNO 5 #P"C:/Documents and
> Settings/Sheldon Ball/")
>
> How can I correctly set the *document_dir* to
>
> C:\Documents and Settings\Sheldon Ball\user name\My Documents

Shouldn't this be c:\Documents and Settings\user name\My Documents  ?

It sound like you inadvertedly is using some settings from you environment
during delivery.

What does (user-homedir-pathname) give?

-- 
  -asbjxrn


Updated at: 2020-12-10 08:47 UTC