Re: Remove file from cache (VC++ 6)

I am writing a program that writes a backup file to a location selected by 
the user (potentially a diskette). Once the backup file is written, I would 
like to re-read  the file to ensure that the backup media is OK. The problem 
is that the file just written is still located in the file cache and any 
attempt to read it just reads it from the cache (not the media itself). I 
would like to know if there is a way to remove this file from the cache 
prior to reading it to ensure the file on the media is good. Thanks in 
advance for any info you can give me on this.

- Robert 


0
10/27/2004 4:31:01 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
629 Views

Similar Articles

[PageSpeed] 29

"Robert Edwards" <development@troopmaster.com> wrote in message news:<e1ptaJEvEHA.3948@TK2MSFTNGP15.phx.gbl>...
> I am writing a program that writes a backup file to a location selected by 
> the user (potentially a diskette). Once the backup file is written, I would 
> like to re-read  the file to ensure that the backup media is OK. The problem 
> is that the file just written is still located in the file cache and any 
> attempt to read it just reads it from the cache (not the media itself). I 
> would like to know if there is a way to remove this file from the cache 
> prior to reading it to ensure the file on the media is good. Thanks in 
> advance for any info you can give me on this.
> 
> - Robert

I'll try.
1. Create backup file with FILE_FLAG_WRITE_THROUGH (see CreateFile).
2. Do FlushFileBuffers then writing is over.
3. Eject disk. Look for 
HOWTO: Eject Removable Media on Windows 95
HOWTO: Ejecting Removable Media in Windows NT/Windows 2000
in MSDN.

Generally, this should help
0
kochkarev (130)
10/28/2004 12:17:52 PM
Reply:

Similar Artilces:

how can I find and download a WAB DLL file for Outlook 2000
When trying to use outlook I get a error message "cannot find WAB DLL" I may have accidently removed it. What OS are you using? Curious since OL2000 isn't Vista compatible. "JEJE" <JEJE@discussions.microsoft.com> wrote in message news:E344280E-7FEC-4550-8255-E1069D4A8621@microsoft.com... > When trying to use outlook I get a error message "cannot find WAB DLL" I > may > have accidently removed it. if you are using vista, see http://www.outlook-tips.net/howto/vista_wab.htm otherwise, we need to know the version of windows. -- Diane Po...

FRx 6.7 SP 9
I just installed SP 9 for FRx 6.7, now when I select a Base Period (periods and Dates window) for each report, I can enter period 11 and I get November 2008, but if I put in period 12, the Report Date changes to August 31, 2002. We previously had a August 31st Fiscal Year end, but havent had that for 4 or 5 years. that is the only thing I can associate with the August 31, 2002. My data I think looks OK but the report heading and the column heading has 08/31/2002 instead of 12/01/2008 is there a table that has year end dates a periods for FRx? -- Doug Doug, I would confirm a few t...

re-post
Using Access 2007. If I have one instance of Access already opened to database#1, then attempt to open another Access db (database#2), I get "Permission Denied". This happens whether I try to Shell out to it, or try using Windows Explorer to open it. Now the twist! If I start db#1, then try to start db#3, it works! There's something about db#2 that makes the Shell command believe that opening it isn't allowed. Now the second twist!! After clicking through the "Permission Denied" error msg, db#2 STILL OPENS! It doesn't do what it's suppose...

xlsx file opens blank
Not sure when it happened or if it's always like this. Upgraded from Office 2003 to 2007. Set everyone up to save to XLS by default, since most people can't use or view the XLSX crap. So, one customer mails us an XLSX file. This lady tries to open it and it opens blank. So, we're sitting at the Excel screen with a light blue background as if no file was opened. Yet, someone else was able to open the same file just fine. Any ideas? Did you try maximizing the document? I've had that happen to me if I have multiple files open, arrange to view all, then c...

Opening excel files
Hi everyone If I open an excel document from my documents, or other location, excel opens but then the file does not open. I can open excel files from excel and using the open command. but not staright from my documents. Any ideas? thanks Sometimes one of these works when you're having trouble with double clicking on the file in windows explorer: Tools|Options|General|Ignore other applications (uncheck it) --- or --- Close Excel and Windows Start Button|Run excel /unregserver then Windows Start Button|Run excel /regserver The /unregserver & /regserver stuff resets the win...

converting to UNICODE, _TCHAR and TCHAR, writing text files
Hi, i'm converting a MFC application to support unicode. I have some (probably noob) questions: - What is the difference between the types _TCHAR and TCHAR ? I see some UNICODE applications use _TCHAR and others TCHAR. - I have to convert the way textfiles are written. These text-files are send to machines using parallel port, so they have to stay the same as before (when my application had no _UNICODE preprocessor definition). The commands that are used to write these files are fputs, fopen, etc. When changing it to support wide characters are the textfiles still the same? example (_U...

Macro to remove contents of cell and move all other contents up one row
I've very lillte or no experience of macros and got some very usefu help from a kind user of this forum a couple of days back and I'm bac looking for more help. Its a bit long winded but here goes. I need a macro which checks the contents of a couple of ranges o cells, starting with the first range of cells lets say it checks cell A4,B4,C4,D4 down to cells A20,B20,C20,D20. Now if for example cell A7,B7,C7 and D7 have values (note the formulas used in these cell means that if A7 has a value then B7,C7 and D7 will also have a valu if A7 is blank then B7,C7, and D7 will be blank) and no...

HOW TO redirect stderr to a file??? (freopen NOT supported)
Hi i'm doing a porting from an application console for win32 to pocketpc 2002, this applicancion have a lot of call to function similar to those: fprintf(stderr, "%s: Unknown error\n", msg); ................. ................. fprintf(stderr, "dropping packet #%u\n", seqno); ................ i want to preserve those functions and redirect stderr to a file but pocketpc sdk and EVC30 doe not support the function "freopen" anyone can soggest me a way to do that redirection? Thanks fclose(stderr); FILE * f = fopen("whatever.txt", "w"); st...

Open Last Modified File form Location
Hi, I have one folder, which has 20 files & I want macro to open last modified file in that folder. Is this can be done?? File Path: C:\Users\Glenys\Desktop\Glen_Macro\ Best Regards, Kam. One way using Dir().. Sub LastModifiedFilewithinFolder() Dim strFile As String, strFolder As String Dim dtLast As Date, strLMFile As String strFolder = "C:\" 'strFolder = "C:\Users\Glenys\Desktop\Glen_Macro\" strFile = Dir("c:\*.*", vbNormal) Do While strFile <> "" If FileDateTime(strFolder & strFile) > dtLast Then dtLas...

Folder List does not display files and folders
Under View, Page is selected with Toggle Pane set to Folder list. No folders or files are displayed. There are files in the default folder called My Web but I'm not able to see these in Folder List. Please can you advise? Thank you in advance. Have you opened a website using File->Open web or File->Open Site ? The file list will be blank until a website is opened in FrontPage. The folder My Documents\My webs is a website. -- Ron Symonds Microsoft MVP (Expression Web) http://www.rxs-enterprises.org/fp Reply only to group - emails will be deleted unread. ...

Remove File Extensions From a List of Files
I have a multiple very long lists containing file names. I'd like to strip the extensions off and compare names together. Does anyone know of a way to make xxxxx.prt turn into xxxxx Thanks justinfoote@freightliner.com> wrote in message news:1143068499.822470.242820@t31g2000cwb.googlegroups.com... >I have a multiple very long lists containing file names. I'd like to > strip the extensions off and compare names together. > Does anyone know of a way to make > xxxxx.prt > turn into > xxxxx > > Thanks If you have all files with a three letter extension, y...

Reply Subject Header
Outlook 2007 SP2 Win 7 Home Premium ______ Want the reply Subject to show Re: instead of RE:. Looked enough places to satisfy even the most hard-headed why-don't-you-look-it-upper. Present config at Tools/Options/Mail Format/International Options - All the boxes checked w/Western European (ISO) selected for Preferred encoding for outgoing messages. Just wondering if there is a way to configure that, or if it's one of those live-with-it-or-change-it-yourself-each-time-you-reply deals. Thanks for your time. franks wrote: >Outlook 2007 SP2 >Win 7 Ho...

Re: Changing a block of cells from relative to absolute references
To the kind person that posted VBA code to do this, my thanks. It appears that this is in fact the easiest (read only) way to do this. I sent it to someone that knows a bit more than me about such things (ie something :) ) and they commented ... This is a very nice tidy piece of code and should work quite well... Except missing a vital "End With" :-) Aint it always the way. :) For the sake of completeness and in the hope that it might prove useful for others, here is the code that worked : '**************************** START OF CODE ****************************** Opti...

Changing Publisher file to PDF file
Hello, I ma just learning to use Publisher. I cannot find the directions on how to change a Publisher file to PDF file if that is possible. I want to link the Publisher file to a website as a PDF file. Thanks Al Krismer Hi Al Krismer (anonymous@discussions.microsoft.com), in the newsgroups you posted: || I ma just learning to use Publisher. I cannot find the || directions on how to change a Publisher file to PDF file if || that is possible. I want to link the Publisher file to a || website as a PDF file. Visit www.primopdf.com for a free PDF converter. -- Brian Kvalheim Microsoft Publis...

Two Many Contact Files
Using Office 2003 Outlook. When I start to create a new email and write in the name it does not auto input the name as I enter it. I have the auto set OK. When I try and answer an email the auto name works OK. I also have another problem in that I have 4 contact lists. One of them has the addresses in it but the default one keeps telling me that the file has been moved or I do not have permission to use it. I have to manual set so that the second contact list opens when I go to the address book. The problem is that when I do that now the auto input of the address will not work. Is the...

Multiple pst files #4
I trying to use multiple pst files. I get an memory error after two pst files are active. There is a KB file( 907651 ) that recommends an Hotkey edit. The issue is that my registry does not have the \PST in this Hotkey recommended. Does anyone have any idea on why this subkey does not exist here?? From KB 907651: 2. Click Start, click Run, type regedit in the Open box, and then click OK. 3. Locate and then click the following registry subkey: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\PST 4. On the Edit menu, point to New, and then click DWORD Value. ...

mail merge to individual document (file)
Hi, is it possible to get Publisher to merge to individual files? I want to EVENTUALLY do the following; Create a Newsletter (using Publisher) Merge it with my client list (to individual files) Create individual PDF files from merge files. Email each customised Newsletter (now as a PDF) to my client base. I know this seems long winded, but I'm open to other suggestions if anyone has any. Thanks in advance Bails <andrewgbaillie@hotmail.com> was very recently heard to utter: > Hi, is it possible to get Publisher to merge to individual files? > > Create individual PDF f...

Where are Outlook 2007 Personal file folders located on my HD?
I would like to transfer all emails within a number of Outlook 2007 Personal mail folders from one computer to another. I know that I can zip each folder, but would like to zip all of them at once and copy the zip file to a USB drive. If I am able to do this, can I simply copy the zipped file to another computer, unzip the folder contents and place them in the correct location so that Outlook will see and list the folders (and the messages therein) on the second computer? Both computers have Outlook 2007. I think that I need the directory location (and file extension?) for the ...

outlook pst file "access denide error"
I am trying to load the pst file from one computer to a new one. each time i use the export/import function I get to the point of importing the file to the new computer and I get an access denied message. since I own both machines how do I get my contacts and email to the new computer Thanks Did you move it to a CD? If so, then you need to Save it to your computer somewhere and then Right click on the saved file to bring up the properties. and remove the "Read Only" property attribute. PST files on a CD are READ ONLY. -- Nikki Peterson [MVP - Outlook] <anonymous@discussi...

removing Outlook 2000's envelope icon in system tray?
I'm running Outlook 2000 on W2k. Once I start up Outlook, it leaves a process running called OUTLOOK.EXE (visable from Task Manager) which, I assume, is what causes Outlook to continue periodically checking for new email -- even after I close Outlook. How can I prevent Outlook from continueing to check email even after I close the program? I suppose that I can change the "check for new messages every xxx minutes" field so that it only checks for new messages when I tell it to. But I'd rather it check automatically when Outlook is running, and then stop checking automat...

packager can not package empty files
what does this mean? What are you doing when you get the message? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "packager can not display" <packager can not display@discussions.microsoft.com> wrote in message news:453E99EE-7B0C-419D-A1E3-015E1BEC8CC4@microsoft.com... > what does this mean? This same error message started showing up today on 90% of the computers in our school computer lab while trying...

sharing a .PST file over a network
Is it possible to access a .PST file on a remote system? We are NOT running Exchange server, yet we want 2 Outlooks running on 2 different systems to have access to the same .PST file. Both machines run XP Home with OUtlook 2003. In attempting open the .PST file with Outlook on the remote system I get a "You do not have permission" type of error. I have tried to remove the read-only attribute on the parent folder, but it seems to continually revert back to read-only. HOwever, if the folder is in fact READ-ONLY then why doesn't the local Outlook have any access i...

Picklist Error
When trying to remove a phantom sub-assembly (and subsequently all of its components) from a picklist, we receive the error "%1 cannot be removed", and the sub-assembly cannot be removed from the picklist. We can usually remove phantom sub-assemblies without a problem, but this issue comes up on occasion. Can anyone decipher the error message an give some insight into why this is occuring? Thanks in advance. ...

Serial Number from Excel File
Hi, It;s possible to extract from a Excel File the Serial number from which this file has been created?? Or other property which determine truly the owner / creator of this Excel File. ...

naming a new file
For some reason whenever I try to do a "save as" and type a name for a new worksheet it will only accept the first letter of the file name. If I try to name it alph.xls it will come up a.xls. any ideas. I have Office 97 on a Windows XP machine. I never had this problem before. Thanks There have been a few posts describing the same problem. I searched google and found this: http://google.com/groups?threadm=020101c30916%2442320250%24a501280a%40phx.gbl The last post in the thread suggested an answer. (I think it has something to do with WindowsXP). I don't think I've ev...