Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 08-31-2006, 10:11
d34ddr34m3r
 
Posts: n/a
Lightbulb

maybe you could try the following routine to search for the '.' from the end of the filename:

Code:
char Filename[]= "c:\\path\\file.ext";
char *BaseFileName;
strrev(Filename);
BaseFileName = strstr(Filename,"."); // search for the '.'
if (BaseFileName){ 
    BaseFileName = (char*)(BaseFileName+1); // exclude the '.'
    strcpy(Filename,BaseFileName);
}
strrev(Filename);
strcat(Filename,".bak\0");
this should work even if the filename does not include a full path
well of course there are still a bunch of ways to implement this.

anyways, hope this helps...
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT +8. The time now is 05:25.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )