Re: FILE_FLAG_DELETE_ON_CLOSE

Tech-Archive recommends: Fix windows errors by optimizing your registry



please look at the CreateFile() fucntion in the MSDN library (or local
help), where it is saying that this flag is nof supported.:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcedata5/html/wce50lrfcreatefile.asp

So this is expected behaviour. Closing the handle should be enough, delete
the file with DeleteFile API,

Erwin Zwart

"John Belli" <jab@xxxxxxxxxxxxx> wrote in message
news:6p5db2pagshr3d7b92o38t891leevk0s8h@xxxxxxxxxx
Is this meant to be unsupported on CE? If I CreateFile(...) with
this flag and immediately CloseHandle(...), the file isn't
deleted, so I'm sure I'm not leaving some other handle open.

I'm using VS2k5 and an HP iPAQ hx2495 (WM5); This is a
dynamically-linkd MFC Dialog app. I have tried compiling as both
PPC2k3 and WM5.

The following 2 lines result in the file named in "tmpName"
existing permanently:

HANDLE tmpFile =
CreateFile(tmpName, GENERIC_READ | GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY |
FILE_FLAG_DELETE_ON_CLOSE, NULL);
CloseHandle(tmpFile);

Is this intended, or do I have something seriously wrong?


JAB


.



Relevant Pages

  • Re: FILE_FLAG_DELETE_ON_CLOSE
    ... where it is saying that this flag is nof supported.: ... So this is expected behaviour. ... Closing the handle should be enough, ...
    (microsoft.public.windowsce.embedded.vc)
  • FILE_FLAG_DELETE_ON_CLOSE
    ... this flag and immediately CloseHandle, ... so I'm sure I'm not leaving some other handle open. ... PPC2k3 and WM5. ... HANDLE tmpFile = ...
    (microsoft.public.windowsce.embedded.vc)