🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7232

Re: FILE Problem

#7232
From: Marco
Date: Mon, 07 Mar 2005 11:04
47 lines
2806 bytes
This is an example of my code:

//-------------------------------------------------------------
void TCompCodici::SaveFile()                       
{                                                  
  FILE *file = fopen (".\\Cfg\\CompCod.dat", "w"); 
  if (file == NULL)
    {
    ShowMessage("Error! Can't open file CompCod.dat");
    return;
    }                                      
  fprintf (file, "[Costanti compilatore]\n");      
  fprintf (file, "NrCodici=%d\n",FLista.Count());  
                                                   
  for (int i=0; i<FLista.Count(); i++)             
    fprintf (file, "%d=%s\n",FLista[i]);           
                                                   
  fclose (file);                                   
}                                                  
//-------------------------------------------------------------void TCompCodici::OpenFile()                       
{                                                  
  char  szBuff[121];                               
  int   i = 0;                                     
  FILE *file = fopen (".\\Cfg\\CompCod.dat", "rt");
  if (file == NULL)
    {
    ShowMessage("Error! Can't open file CompCod.dat");
    return;
    }
  while (!feof(file))                              
    {                                              
    fgets(szBuff, 120, FMsgFile);                  
    FLista[i] = szBuff;                            
    i++;                                           
    }                                              
}                                                  
//-------------------------------------------------------------

FLista is a stringlist.
My problem is that if i try to open file on my PC sometimes
error occours but if i copy all my folder on another PC all 
work correctly (always).
Could WinXP (API or somethingelse) give the problem?

Thanks.
Marco
Technical Details
Message-ID: <422c3529$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <422c284b$1@newsgroups.borland.com> <422c2ce5@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,dd88f23059572aae
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Marco" <mliorni@NoMail.com>
Sender: "Marco" <mliorni@NoMail.com>
Reply-To: "Marco" <mliorni@NoMail.com>
Subject: Re: FILE Problem
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 195.103.152.66     
X-Forwarded-For: 130.130.62.59, 195.103.152.85
References: <422c284b$1@newsgroups.borland.com> <422c2ce5@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <422c3529$1@newsgroups.borland.com>
Date: 7 Mar 2005 03:04:09 -0800
X-Trace: newsgroups.borland.com 1110193449 207.105.83.66 (7 Mar 2005 03:04:09 -0800)
Lines: 48
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail