File open issue, after file deleted. fopen status is failing in VC++

/* fopen example */
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
  FILE * pFile;
  for(int i=0; i < 1000000; i++)
            bool ret = remove("C:\\abc.txt");
            pFile = fopen ("C:\\abc.txt","w");
            if (pFile!=NULL)
                        fputs ("fopen example",pFile);
                        fclose (pFile);
            else
                        printf("%d fopen() fails \n", count);
  return 0;
Here, after remove is called, pFile = fopen ("C:\\abc.txt","w");is called,
Sometimes even in C:\ the abc.txt file is not present after remove called, but the fopen pFile pointer is null.
This is reproduced some times not always. In this example this issue is reproduced 50/60 times.
Please suggest some solution.

Hi,
Please post in following development forum about VC++ issue:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral
Alex Zhao
TechNet Community Support

Similar Messages

  • Excel for Mac File- Open Issue after latest OS X update (Yosemite)

    Using Excel for Mac 14.4.8 (on OS X Yosemite 10.10.3) always defaults to the Documents directory when using File->Open.  It will not remember last directory a file was opened from.  Has anyone else experienced this?  This did not happen
    before the latest OS X update.
    (If this is not the right forum, could you please tell me which forum is for Excel for Mac questions.)

    Hi
    This is the forum for discussions about Excel development (VBA, automation) on Windows platform. Since your issue is about Excel on Mac OS ,I will suggest you posting this thread on Office for Mac so that you will get more effective and more professional
    help there.
    Office for Mac: http://answers.microsoft.com/en-us/mac
    Thanks for your understanding.
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do I restore a file to iTunes after I deleted it using Keep File?

    I wanted to shorten the list of visible files in my laptop's iTunes Music folder without losing the actual music.  So I selected Keep File.  Now I want to bring some of that music back. 
    How do I restore a file to iTunes after I deleted it using Keep File?

    Assuming the track file is still there, either use the Add To Library command under the File menu in iTunes and select the tracks you wish to add back into the iTunes library, or find the track files on your hard drive and drag them into the iTunes window.
    Regards.

  • Launching Microsoft Access from Internet Explorer to view a downloaded MDB file opens the wrong file (not a problem if I use Firefox)

    When clicking on a link (in Internet Explorer 9) to download an Access MDB file and then choosing to open the file directly in Microsoft Access (2007) instead of saving it, the file is copied to Temporary Internet Files but Microsoft Access tries to open
    a different file and displays an (Unrecognized database format) error.
    When I click on the option to open the file, the MDB file is copied to Temporary Internet Files\Content.IE5 but instead of that file, Access tries to open a different (incorrect) file located in Temporary Internet Files\Content.MSO (e.g. in the above error
    message, NativeView.do is an XML file containing an error message).
    I don't see this problem with Word, Excel or PowerPoint files. When opening a Word file (without saving) the Word file is copied to Content.IE5 but an identical .tmp file is created in Content.MSO which when opened in Microsoft Word displayed the required file
    correctly. The same happens for Excel files. PowerPoint appears to be handled a little differently (no .tmp file created in Content.MSO but the required file is still copied to Content.IE5) but the PPT file is still opened correctly in Microsoft PowerPoint.
    I think the Content-Type "application/msaccess" is fine because Internet Explorer does launch Microsoft Access. It just tries to open the wrong file (or so I think). However, it looks like the file type is not being determined. Here is what I noticed
    when trying to open different Microsoft Office files using Internet Explorer:
    The last one is the MDB file. As you can see, only for this type of file, the "Type" (Microsoft Office Access 2007?) is not displayed in this Open/Save dialog box.
    On Firefox, I don't see this problem. When I tried clicking on the link to the MDB file in Firefox, Microsoft Access was launched and the file was opened correctly. Is there something I can do so the MDB file is opened properly using IE? I can add/change headers
    in the HTTP response that writes this file to the output stream (on disk) if that helps.
    Thanks for your time!

    Sounds like a problem symptom to be discussed in either an IE forum or an Access forum, not here.  How did you come to post here?  ForumsRedesign.  That might be an on-topic issue for this forum.  <eg>
    Can you find your way to either of those other forums easily from here?  Another on-topic question for here I think.   ; )
    Robert Aldwinckle
    Oops, my bad. Thanks for letting me know! :)
    I've re-posted it here: http://social.technet.microsoft.com/Forums/ie/en-US/1a818501-296c-42fb-8abb-ba914629c962/launching-microsoft-access-from-internet-explorer-to-view-a-downloaded-mdb-file-opens-the-wrong-file?forum=ieitprocurrentver
    Hopefully that's the right place for this.
    Cheers!

  • "Ghost' file opening behind other files

    Mac OS 10.7.3
    After a few hours of working in CS6 I find that file opens behind the files that I'm currently working on. 
    This file always carries the name of a previously opened file, but it has no content; it has a white background but no layers - not even a background layer.  No matter how many times I close it down, as soon as I start to work on another file it's back up again. 

    Sounds like it could be a GPU driver isssue.
    Could you include your System Info from Photoshop's Help > System Info dialog box?
    You could also try disabling OGL in the GPU preferences
    Photoshop menu > Preferences > Performance
    Uncheck "Use Graphics Processor"
    Let us know how it goes!

  • DVD-MOV mpegstream clip error: "File open error: unsupported file type"

    I do it all the time this is the only time i've gotten this error, i use mpeg stream clip. I have a dvd I got from a DVR recorder, I open the dvd which shows 2 VOB files in the TS folder. the MENU gives "Warning: the stream may have timecode breaks." I "Fix Now" and it works fine. But i dont want the menu. the other VOB file in the TS folder, which should be the "movie I want" gives this error when opened,
    "File open error: unsupported file type"
    when I open anyway, I get an audio bar which has no sound, and no video.
    ANY IDEAS? I've been on this for hours PLEASE

    Hi,
    Do you have the [MPEG-2 component|http://www.apple.com/quicktime/mpeg2> installed on your computer? If not, you will need it to be able to convert VOB files.

  • What makes a file open automatically after download? I'm trying to stop it. I don't know whether Firefox or Sumatra controls this.

    When I downloaded a .pdf file, it opens automatically after download. I want to put it back to where I have to click on it in the download window in order to open it.
    This happens with every .pdf file I download.
    I am using Sumatra 1.5.1 to view pdf files.

    http://support.mozilla.com/en-US/kb/Managing+file+types
    Change the '''Action''' for that file type.

  • Endless loop on file opening issue in MS Word 2011 pro on Mac OS Mavericks

    MS Word 2011 Pro on Mac OS Mavericks. 
    The problem: 
    When open Word (Office 2011 on Mac), it will start opening all previous files on the mac until it crashes with error. The problem duplicates when force quite MS Word. Reinstall Office 2011 won't fix it. Deleting com.microsoft.word.plist won't help. No duplicated
    fonts in Fron Book. Did not know what caused this problem. Excel works fine. This is a problem only appeared on Word so far. 
    Any help is appreciated. 
    Thanks, 
    Liyun 

    Hi,
    We provide support for Office programs on Windows in this forum, since you are using Word 2011 on Mac, to get a better assistance, please post the question to Office for Mac forum:
    http://answers.microsoft.com/en-us/mac
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Melon Chen
    TechNet Community Support

  • File Open Issues - document library pdf file to open in new browser window

    Hi
    I have a requirement to open the document library containing pdf file to open in new browser window. So far I have tried following steps but could not get it to work.
    1. Changing Document library advance setting to open the document in browser (have tried others as well).
    2. SharePoint web application setting changed as Permissive instead of Strict. Here the pdf file opens in browser but redirect from document library instead of new window(Also tried adding Target=”_blank” and no change).
    3. Executed the powershell script to adding MIME type to see if it works but no change.
    $webApp = Get-SPWebApplication http://SharePointSite
    If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains "application/pdf")
    Write-Host -ForegroundColor White "Adding PDF MIME Type..."
    $webApp.AllowedInlineDownloadedMimeTypes.Add("application/pdf")
    $webApp.Update()
    Write-Host -ForegroundColor White "Added and saved."
    Else
    Write-Host -ForegroundColor White "PDF MIME type is already added."
    4. Open the Doc library and modified ALLItems.aspx to add Target= “_blank”
    5. I have already tried solutions suggested in the link:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/9db08c4a-b53c-419a-84f8-001c194d1311/how-to-open-sharepoint-document-library-pdf-file-in-new-window?forum=sharepointadminlegacy
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/530e2ea1-d77d-491c-935f-04f536e439a5/open-a-pdf-document-to-a-new-browser-in-the-document-library-web-part?forum=sharepointadminlegacy
    http://mindsharpblogs.com/todd/archive/2005/08/16/654.html
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/7b6091df-4657-4799-ba02-259ebd7e4b7c/pdf-doesnt-open-in-document-library?forum=sharepointadminlegacy
    Appreciate if there are any working solution from any of you. Many Thanks

    I found a solution which works only in the development. No idea when I compared, Browser MIME type is enabled, STRICT browser type is configured for web application. on the document library advance setting, default to open in new browser. Both configurations
    are identical but I am able to open pdf file in new window in my developing using jquery script
    http://blog.ithinksharepoint.com/2011/02/21/open-pdf-files-from-a-document-library-in-a-new-window/ but the same does not work on production server :(
    Any help experts?
    Thanks

  • Acrobat Pro file open issues @ VDI

    While opening PDF file in Acrobat Pro 9 under the VDI user environment, the Acrobat starts and automatically simultaneously closes without any error message.
    Opening the same file in Acrobat reader becomes without any problems.
    We use VDI based on Citrix XenDesktop v.7.5;
    Hypervisor - VMWare vSphere v.5.0.1U1;
    MS AD - W2k8R2
    User Virtual machines based on OS Windows 7 (32 bit);
    All User files are stored on file server, which are provided by storage EMC VNX5400 and accessible through CIFS protocol. We user folder redirection for user folders

    Unsupported configuration: 12   Citrix Deployments — Enterprise Administration Guide.
    Ben

  • File open error: unsupported file type Mpeg Streamclip

    having a problem... I am using mpeg streamclip to convert vob files from a dvd. the problem is that the program says that the first vob file is an unsupported file type. I know that this is not true. The DVD plays, and the remaining vob files are opened and processed by the program correctly. Any advice or suggestions?

    I am having the same problem. The first VOB file in the sequence will not open in either Streamclip or Quicktime. This is not the menu display image, but the first chunk of the video (the menu image actually will open). All the ones after it can be opened either individually or joined as a group.
    The DVD plays fine on the mac and also in the regular DVD player. Any idea if this is perhaps some equipment fault when the DVD burner "finalizes" the disk? Am using a combo VHS/DVD-R unit. It is not super high-end, but then neither are these old home videos I'm converting.

  • .AI files opening as text files in illustrator.

    I created two pieces of work last night, 2/4/15, using Adobe Illustrator and once completed I saved the files and haven't moved them from their original destination. I attempted to open the files today, 2/5/15, and have a pop up saying that it is opening the files as a text document and upon proceeding am met with a blank new document in the size of the file I had saved. A majority of previous files open with no problem and all have the same .ai extension and show the preview. Any help would be greatly appreciated as I'm not sure what caused this issue and I haven't run into in previously. Thank you.
    I have attached photos of the screen that appears upon opening the .ai files in illustrator.

    Hardy,
    You may see whether the file size seems right.
    You have already tried to create a new document and File>Place the corrupted one to see how much may be rescued that way.
    You may also try to open the document with Adobe Acrobat, if it was saved with PDF Compatible file ticked, then save it as PDF and try to open that.
    Here are some websites where you can see whether it can rescue the file, and if it can, you may pay for a subscription to have it done,
    http://www.recoverytoolbox.com/buy_illustrator.html
    http://markzware.com/adobe-software/fix-illustrator-file-unknown-error-occurred-pdf2dtp-fi le-recovery/
    http://www.illustrator.fixtoolbox.com/
    As far as I remember, the first one is for Win and the one is for Mac, while the third one should be for both.
    Here are a few pages about struggling with it yourself:
    http://daxxter.wordpress.com/2009/04/16/how-to-recover-a-corrupted-illustrator-ai-file/
    http://helpx.adobe.com/illustrator/kb/troubleshoot-damaged-illustrator-files.html
    http://kb2.adobe.com/cps/500/cpsid_50032.html
    http://kb2.adobe.com/cps/500/cpsid_50031.html
    http://helpx.adobe.com/illustrator/kb/enable-content-recovery-mode-illustrator.html

  • Opening a Numbers file opens all Numbers files

    When I open a file created with Numbers 09, not only that file opens, but other (non-linked and unrelated) files I created with Numbers also open. Is there a way I can stop this and only open the files I want to work on? At about the same time this started, I also started getting an error message form, that doesn't have any content everytime I open Numbers. See enclosed image:
    Appreciate any help or advice.
    Thanks.

    Thanks, Jerry.
    I couldn't find anyplace in SystemsPref>Gen to cause files to close when I quit the app, but I did close the files one-by-one and when reopening the one I wanted found that only that one opened. So that did solve the problem for me.
    But I'm still curious about the "Document Warning" window that doesn't show any warning. It obviously isn't related to the opening of the extraneous Numbers files, but does show up everytime I open any file in Numbers now.
    Thanks for your help, Jerry!

  • Duplicate File Handling Issues - Sender File Adapter - SAP PO 7.31 - Single Stack

    Hi All,
    We have a requirement to avoid processing of duplicate files. Our system is PI 7.31 Enh. Pack 1 SP 23. I tried using the 'Duplicate File Handling' feature in Sender File Adapter but things are not working out as expected. I processed same file again and again and PO is creating successful messages everytime rather than generating alerts/warnings or deactivating the channel.
    I went through the link  Michal's PI tips: Duplicate handling in file adapter - 7.31  . I have maintained similar setting but unable to get the functionality achieved. Is there anything I am missing or any setting that is required apart from the Duplicate file handling check box and a threshold count??
    Any help will be highly appreciated.
    Thanks,
    Abhishek

    Hello Sarvjeet,
    I'd to write a UDF in message mapping to identify duplicate files and throw an exception. In my case, I had to compare with the file load directory (source directory) with the archive directory to identify whether the new file is a duplicate or not. I'm not sure if this is the same case with you. See if below helps: (I used parameterized mapping to input the file locations in integration directory rather than hard-coding it in the mapping)
    AbstractTrace trace;
        trace = container.getTrace();
        double archiveFileSize = 0;
        double newFileSizeDouble = Double.parseDouble(newFileSize);
        String archiveFile = "";
        String archiveFileTrimmed = "";
        int var2 = 0;
        File directory = new File(directoryName);
        File[] fList = directory.listFiles();
        Arrays.sort(fList, Collections.reverseOrder());
        // Traversing through all the files
        for (File file : fList){   
            // If the directory element is a file
            if (file.isFile()){       
                            trace.addInfo("Filename: " + file.getName()+ ":: Archive File Time: "+ Long.toString(file.lastModified()));
                            archiveFile = file.getName();
                          archiveFileTrimmed = archiveFile.substring(20);       
                          archiveFileSize = file.length();
                            if (archiveFileTrimmed.equals(newFile) && archiveFileSize == newFileSizeDouble ) {
                                    var2 = var2 + 1;
                                    trace.addInfo("Duplicate File Found."+newFile);
                                    if (var2 == 2) {
                                            break;
                            else {
                                    continue;
        if (var2 == 2) {
            var2 = 0;
            throw new StreamTransformationException("Duplicate File Found. Processing for the current file is stopped. File: "+newFile+", File Size: "+newFileSize);
    return Integer.toString(var2);
    Regards,
    Abhishek

  • Unexpected error opening catalog after accidentally deleting and recovering catalog file

    I deleted my Lightroom folder by mistake. I have recovered the Lightroom 5 catalog .Ircat file using recovery software but when I try to open it I get the message "Unexpected error opening catalog". Please help!
    I have tried creating a new catalog and importing the .ircat file but I then get told that it is not a valid lightroom catalog.
    I have a lot of photo edits that I really need to recover, I hope someone can help.
    Kind regards, Alex

    Hi Alex,
    I just did the same thing.  What recovery software did you use?? Also, were you ever able to recover your pics?
    Thanks for your help x

Maybe you are looking for