Safe place to write a file under Vista

Jim Bufalini jim at visitrieve.com
Wed Sep 2 12:00:56 EDT 2009


Richard Miller wrote:

> I am finding that, on some Vista machines with some user settings, it
> is
> not possible to write a file from Rev to the root C drive. Seems that
> Vista blocks this action. Does that sound about right? If so, where is
> a
> reliable, safe place to write a file (which will soon thereafter be
> deleted)? Is specialfolderpath("documents") safe?

This is a bit of a pet peeve of mine. ;-) Documents, which under XP and
previous versions of Windows was called My Documents, is "safe" to write to
by an application in the sense that the UAC of the OS will not prevent
writing to this directory. 

However, this directory is really for what it used to be called "My"
Documents. This means .DOC, .XLS, .TXT, etc. that I, as a user created. It
is very annoying to a Windows user to see application data showing up in
this directory. If I want to get back to a DOC I recently created, I often
sort by Last Modified Date and it is annoying to see files created by some
application, which are "garbage" to me.

It is better to use the ProgramData (in Vista or Application Data in XP and
previous) for this purpose. Always create a subdirectory under this
directory for your application first. And be aware, if you are storing
settings or a database that needs to be accessed by more than one user of a
system, then Application Data (or Documents, for that matter) will vary by
user where ProgramData (on Vista) or the Application Data of All Users is
best for storing common data.

Aloha from Hawaii,

Jim Bufalini




More information about the use-livecode mailing list