File size: 522 Bytes
80a72c3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
#include <string.h>

void GetFileNameFromPath(char *Path, char *FileName)
{

  int i;
  static char DirDelim[5] = { ':','/','\\',']','\0'};

  for( i = (int)strlen(Path)-1; i>=0; i-- )
    if( strchr(DirDelim,Path[i]) ) break;

  strcpy(FileName,Path+i+1);
}


void StripPathFromLastExtention(char *Path, char *StrippedPath)
{
  int i;

  strcpy(StrippedPath,Path);

  for( i = (int)strlen(StrippedPath); i>=0; i-- )
    if( StrippedPath[i] == '.' ) {
      StrippedPath[i] = '\0';
      break;
    }
}