Return to Snippet

Revision: 17023
at August 21, 2009 07:46 by tandouri


Updated Code
/* ------------------------------------------------------------------------------- *\
| # get_filename_from_path : searches a given filepath for its name                 |
| @param	           : char* to the existing filepath	                    |
| @return	           : char* to the found filename			    |
\* ------------------------------------------------------------------------------- */
char* get_filename_from_path(char* filepath)	{

	char *filename = (char*)calloc(1, sizeof(SIZE_FILENAME));
	filename = (strrchr(filepath, '/'))+1;
	printf(" found filename: %s \n", filename);
	
	return filename;

}

Revision: 17022
at August 21, 2009 03:54 by tandouri


Initial Code
/* ------------------------------------------------------------------------------- *\

| # get_filename_from_path : searches a given filepath for its name                 |

| @param	           : char* to the existing filepath	                    |

| @return	           : char* to the found filename			    |

\* ------------------------------------------------------------------------------- */
char* get_filename_from_path(char* filepath)	{

	char *filename = (char*)calloc(1, sizeof(SIZE_FILENAME));
	filename = (strrchr(filepath, '/'))+1;
	printf(" found filename: %s \n", filename);
	
	return filename;

}

Initial URL

                                

Initial Description
for cmdparsing

Initial Title
get filename from a filepath

Initial Tags
file, path, find

Initial Language
C