Re: temp directory question



On Apr 6, 8:13 am, "Aussie Rules" <aus...@xxxxxxxxxx> wrote:
Hi,

In my application I need to write an XML file to disk, but am concerned that
permission might be a problem.

The file only needs to be written out and used for another reason and can
then be deleted.

I was thinking about using the windows/system temp directory as the
location, as I guess that a directory where my application shouldn't have an
issue writting to.

Is this the best location for this file to go? and how do I determine what
the temp directory is ?

Thanks

If you have any difficulty about writing to a specific folder such as
temp (plus you may able to write), create your own temp folder in your
application folder then delete folder / file after operation has
finished.

For example when you need a folder temporarily, create a new one
using:
System.IO.Directory.CreateDirectory("c:\your_app\your_folder")

Then you can delete folder fairly after the directory is not needed
anylonger using:
(usually when formclosing event is fired)
System.IO.Directory.Delete("c:\your_app\your_folder")

Therefore you have a folder that's created and deleted temporarily,
just my opinion.

Regards,

Onur Güzel
.



Relevant Pages

  • Re: temp directory for asp.net?
    ... Pick a folder and write to it explicitly and make sure the default ASPNET ... "Lars Netzel" wrote in message ... > I'm trying to write a PDF to disk on the server ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Deleting specific folder within %temp%
    ... to delete a specific folder in the temp directory. ... For Each oSubFolder In oFolder.SubFolders ... Sub BLATSubFolders (SubPath) ...
    (microsoft.public.scripting.vbscript)
  • Re: temp directory question
    ... This will cause you a problem in Windows Vista if your application is installed in ProgramFiles. ... I was thinking about using the windows/system temp directory as the ... temp, create your own temp folder in your ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Retrieving lost photos
    ... in a temp directory, ... worth a try since you may be able to recover some of the picture files. ... briefly flashed on the screen and the folder disappeared. ... It's also a very good idea to have the verify option set in the CD ...
    (microsoft.public.windowsxp.photos)
  • Re: saving word document
    ... If you Save As to a specific folder, this folder will be the default the ... established or the one Windows or your email client is using as a temp ... >> Microsoft MVP ... >>> temp directory where it was originally opened. ...
    (microsoft.public.word.docmanagement)

Loading