append_filename(3alleg4) Allegro manual append_filename(3alleg4)NAME
append_filename - Concatenates a filename to a path. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
char *append_filename(char *dest, const char *path, const char *filename, int size);
DESCRIPTION
Concatenates the specified filename onto the end of the specified path, storing at most `size' bytes into the `dest' buffer. If `path'
doesn't have a trailing path separator, the function will append one if needed. You can use the same buffer both as input and output
because Allegro internally works on a copy of the input before touching `dest'. Example:
append_filename(buf, "/home/user",
"prog.bin", sizeof(buf));
RETURN VALUE
Returns a copy of the `dest' parameter.
SEE ALSO replace_filename(3alleg4)Allegro version 4.4.2 append_filename(3alleg4)
Check Out this Related Man Page
make_relative_filename(3alleg4) Allegro manual make_relative_filename(3alleg4)NAME
make_relative_filename - Tries to make a relative filename from absolute path and filename. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
char *make_relative_filename(char *dest, const char *path, const char *filename, int size);
DESCRIPTION
Attempts to make a relative filename from an absolute path and an absolute filename, storing at most `size' bytes into the `dest' buffer.
This function won't work if the paths are not canonical under the current platform (see canonicalize_filename()). Also, `dest' cannot be
used as input value for `path' or `filename'. Example:
char base[] = "/long/absolute/path/program.exe";
char user_input[] = "/nice/and/short.txt";
...
make_relative_filename(buf, base, user_input, sizeof(buf));
/* Under Unix buf would contain:
../../../nice/and/short.txt */
RETURN VALUE
Returns a copy of the `dest' parameter if it succeeds or NULL if it fails (eg. under DOS, one path starts with "C:" and another with
"A:").
SEE ALSO make_absolute_filename(3alleg4), is_relative_filename(3alleg4), canonicalize_filename(3alleg4)Allegro version 4.4.2 make_relative_filename(3alleg4)
I am working on an shell script which checks for all the file starting with abc*.*
and if file found then the filelines need to append the file name in begining
can some one help with the filename appending...
for i in `ls $filename*.csv`
do
echo $i
--- NEED to append file name befor... (3 Replies)
How to add the filename to end of each line with | as seperator, except first and last line of the file(s) in directories(with diff tree structure) using shell script?. And also how to replace a list of strings with another set of strings, which is present in a file?.
Kindly help out on... (1 Reply)
Hello,
I need to create a shell script that appends a filename to create a name with the date and time appended that is guaranteed to not exist. That is, the script insures you will not overwrite a file with the same name. I am lost with this one. I know I need to use date but after that I am... (3 Replies)
Assume I have 2 gz files with 2 lines each as below
a.gz
a1,a
a2,a
b.gz
b1,b
b2,b
If I issue
gzip -d -c *.gz
I will get below in the stdout
a1,a
a2,a
b1,b
b2,b
What I need it the filename appended to each row either at the front or back.
a.gz,a1,a
a.gz,a2,a (2 Replies)