Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: compare c++/MFC to C#/.net Pin
Green Fuze11-Jan-09 6:48
Green Fuze11-Jan-09 6:48 
Question::FindFirstFile problem [modified] Pin
Loreia10-Jan-09 4:48
Loreia10-Jan-09 4:48 
AnswerRe: ::FindFirstFile problem Pin
Luc Pattyn10-Jan-09 5:15
sitebuilderLuc Pattyn10-Jan-09 5:15 
GeneralRe: ::FindFirstFile problem Pin
Loreia10-Jan-09 5:52
Loreia10-Jan-09 5:52 
GeneralRe: ::FindFirstFile problem Pin
Luc Pattyn10-Jan-09 6:03
sitebuilderLuc Pattyn10-Jan-09 6:03 
GeneralRe: ::FindFirstFile problem Pin
Loreia10-Jan-09 6:20
Loreia10-Jan-09 6:20 
GeneralRe: ::FindFirstFile problem Pin
Luc Pattyn10-Jan-09 6:46
sitebuilderLuc Pattyn10-Jan-09 6:46 
GeneralRe: ::FindFirstFile problem Pin
Loreia10-Jan-09 7:55
Loreia10-Jan-09 7:55 
Thanks, you last suggestion helped me better understand how TEMP files work.

When I run test program on my hard drive, "test_file.txt" is not created at all, Explorer simply doesn't show it. I can see file only when I run program on my USB drive. After realizing that, I re-read this sentence from MSDN:

"Specifying the FILE_ATTRIBUTE_TEMPORARY attribute causes file systems to avoid writing data back to mass storage if sufficient cache memory is available, because an application deletes a temporary file after a handle is closed. In that case, the system can entirely avoid writing the data."

So, TEMP file is held in memory as long enough cache memory is available. And after seeing that file is NOT deleted on my USB stick, I can verify that application is the one responsible for deleting file (unless FILE_FLAG_DELETE_ON_CLOSE is set in CreateFile)

Now, at least I fully understand what MSDN documentation says about FILE_ATTRIBUTE_TEMPORARY Smile | :) .

Off course, my problem still remains. GetFileAttributes and FindFirstFile *should* see the same set of file attributes, and should report the same DWORD value.

And BTW, you really have a "hawk eye", I meant to call CreateFile with FILE_ATTRIBUTE_TEMPORARY parameter but I made a mistake when copied source code here (in original that parameter is "*iter").
But it doesn't change much, no matter how I create file, once I set TEMP attribute, FindFirstFile chokes on it(on FAT32).
GeneralRe: ::FindFirstFile problem Pin
Luc Pattyn10-Jan-09 8:09
sitebuilderLuc Pattyn10-Jan-09 8:09 
GeneralRe: ::FindFirstFile problem Pin
Loreia10-Jan-09 8:33
Loreia10-Jan-09 8:33 
GeneralRe: ::FindFirstFile problem Pin
Randor 10-Jan-09 8:59
professional Randor 10-Jan-09 8:59 
GeneralRe: ::FindFirstFile problem Pin
Loreia10-Jan-09 10:09
Loreia10-Jan-09 10:09 
GeneralRe: ::FindFirstFile problem Pin
Randor 10-Jan-09 10:45
professional Randor 10-Jan-09 10:45 
GeneralRe: ::FindFirstFile problem Pin
Loreia10-Jan-09 10:56
Loreia10-Jan-09 10:56 
GeneralRe: ::FindFirstFile problem Pin
Luc Pattyn10-Jan-09 10:11
sitebuilderLuc Pattyn10-Jan-09 10:11 
QuestionRe: ::FindFirstFile problem Pin
David Crow12-Jan-09 3:36
David Crow12-Jan-09 3:36 
AnswerRe: ::FindFirstFile problem Pin
Loreia12-Jan-09 7:24
Loreia12-Jan-09 7:24 
QuestionCan I handle click events on a static control [SOLVED] Pin
sashoalm10-Jan-09 4:15
sashoalm10-Jan-09 4:15 
AnswerRe: Can I handle click events on a static control Pin
Randor 10-Jan-09 4:35
professional Randor 10-Jan-09 4:35 
GeneralRe: Can I handle click events on a static control Pin
sashoalm10-Jan-09 5:01
sashoalm10-Jan-09 5:01 
GeneralRe: Can I handle click events on a static control Pin
Code-o-mat10-Jan-09 5:43
Code-o-mat10-Jan-09 5:43 
GeneralRe: Can I handle click events on a static control Pin
Randor 10-Jan-09 6:15
professional Randor 10-Jan-09 6:15 
GeneralRe: Can I handle click events on a static control [modified] Pin
sashoalm10-Jan-09 6:59
sashoalm10-Jan-09 6:59 
GeneralRe: Can I handle click events on a static control Pin
sashoalm10-Jan-09 7:32
sashoalm10-Jan-09 7:32 
GeneralRe: Can I handle click events on a static control Pin
Randor 10-Jan-09 7:35
professional Randor 10-Jan-09 7:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.