Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

get_filename(3alleg4) [v7 man page]

get_filename(3alleg4)						  Allegro manual					     get_filename(3alleg4)

NAME
get_filename - Returns a pointer to the filename portion of a path. Allegro game programming library. SYNOPSIS
#include <allegro.h> char *get_filename(const char *path); DESCRIPTION
Finds out the filename portion of a completely specified file path. Both `' and `/' are recognized as directory separators under DOS and Windows. However, only `/' is recognized as directory separator under other platforms. Example: get_executable_name(name, sizeof(name)); allegro_message("Running `%s' ", get_filename(name)); Note that Allegro won't perform any IO operations during the verification. This means that if you have `/a/path/like/this/', which doesn't have a filename, the function will return a pointer to the trailing null character. However, if you have `/a/path/like/this', Allegro will return a pointer to `this', even if it is a valid directory. RETURN VALUE
Returns a pointer to the portion of `path' where the filename starts, or the beginning of `path' if no valid filename is found (eg. you are processing a path with backslashes under Unix). SEE ALSO
get_extension(3alleg4), put_backslash(3alleg4), replace_filename(3alleg4), exmidi(3alleg4) Allegro version 4.4.2 get_filename(3alleg4)

Check Out this Related Man Page

get_filename(3alleg4)						  Allegro manual					     get_filename(3alleg4)

NAME
get_filename - Returns a pointer to the filename portion of a path. Allegro game programming library. SYNOPSIS
#include <allegro.h> char *get_filename(const char *path); DESCRIPTION
Finds out the filename portion of a completely specified file path. Both `' and `/' are recognized as directory separators under DOS and Windows. However, only `/' is recognized as directory separator under other platforms. Example: get_executable_name(name, sizeof(name)); allegro_message("Running `%s' ", get_filename(name)); Note that Allegro won't perform any IO operations during the verification. This means that if you have `/a/path/like/this/', which doesn't have a filename, the function will return a pointer to the trailing null character. However, if you have `/a/path/like/this', Allegro will return a pointer to `this', even if it is a valid directory. RETURN VALUE
Returns a pointer to the portion of `path' where the filename starts, or the beginning of `path' if no valid filename is found (eg. you are processing a path with backslashes under Unix). SEE ALSO
get_extension(3alleg4), put_backslash(3alleg4), replace_filename(3alleg4), exmidi(3alleg4) Allegro version 4.4.2 get_filename(3alleg4)
Man Page

8 More Discussions You Might Find Interesting

1. Programming

filename to string

working with the Win32API I am trying to implement a function in my program that will take the full filename and path of a shortcut (.lnk) file and returns an std::string that is the path+filename+arguments of the program to run, and also a STARTUPINFO structure that can be passed to... (1 Reply)
Discussion started by: cprognew
1 Replies

2. UNIX for Dummies Questions & Answers

Remove path from filename

In a foreach loop I end up with $file containing the filename INCLUDING the whole path. I want this reduced to just the filename, but I can't seem to remember how I did it some years back. I am sure I can do it with "sed", but I am pretty sure I have seen a simpler command. Anyone? borgeh (3 Replies)
Discussion started by: borgeh
3 Replies

3. Solaris

file name from file descriptor

Hi Can we get the full path of the filename from file descriptor. pread64(405, "0602\0\0\0960EB9DC BC7F9".., 16384, 0x0000000583AE4000) = 16384 How do i get the filename with full path of the file with fd=405 regards (2 Replies)
Discussion started by: xiamin
2 Replies

4. Shell Programming and Scripting

Extracting a portion of the filename

Hi I would like to extract the first portion of filename from a list of files. The filename pattern is of the form 123456789_TEXT_TEXT_TEXT_.csv. I want to extract just the numerical portion of this filename from the list of files and then output this into another text file. K (6 Replies)
Discussion started by: kamal_p_99
6 Replies

5. Windows & DOS: Issues & Discussions

Check dir for overly path+filename and list in txt

Well since Windows always laments over some of my files having a too long "path+filename" and it gets in the way of copying complete directory structures I would love to have a DOS Script that helps me with finding those. I already tried DCSoft Long Filename Finder but that is neither DOS based... (3 Replies)
Discussion started by: pasc
3 Replies

6. Shell Programming and Scripting

Sorting using filename of a path

Hi all! i have a question how do you sort the filename of a path directory according to alphabetic order. Example: sort according to highlighted text. There maybe space for filename Path=/home/pikamon/Desktop/ABC; Path=/home/pikamon/Desktop/ABD; Path=/home/pikamon/Desktop/Riduan la;... (5 Replies)
Discussion started by: pikamon
5 Replies

7. UNIX for Beginners Questions & Answers

Extracting directory portion.

Dear Experts, I have some directory structure something like follows. I would like to cut portion of it. Would you please help me? I have to run this on several sql's. The directory path is dynamic. I have cut what comes after first "sql" string. Input:... (3 Replies)
Discussion started by: srikanth38
3 Replies

8. UNIX for Beginners Questions & Answers

How to use sed to insert character in the beginning of file path?

I need to manipulate one Database file on Solaris 11 in which contains more than 5000 lines of data file path like this: '/data1/oradata/DBNAME/system01.dbf', '/data7/oradata/DBNAME/undotbs1_01.dbf', '/data1/oradata/DBNAME/sysaux01.dbf', '/data28/oradata/DBNAME/userdata01.dbf', ... (6 Replies)
Discussion started by: duke0001
6 Replies