FNQUALIFY(3pub) C Programmer's Manual FNQUALIFY(3pub)NAME
fnqualify - qualify a filename
SYNOPSIS
#include <publib.h>
size_t fnqualify(char *result, const char *path, size_t max);
DESCRIPTION
fname_qualify qualifies a filename. This means that if the input name is not an absolute name (i.e. starts from the root directory, e.g.
is foo, not /tmp/foo), the current directory will be prepended to it. Also, tilde conversion is done: if the filename begins with a tilde
(~), the tilde is replaced with the home directory of the user, and if it begins with a tilde and a username, both are replaced with the
home directory of the given user.
Simplifications like replacing /./ with /, and /foo/../bar with /bar are not done because of problems with symbolic links.
RETURNS
The function returns -1 if there was some error, or the total size of the full name otherwise. The return value may be greater than the
maximum size given by the last argument; only as much as allowed by that is actually written, though.
SEE ALSO publib(3), fname(3)AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual FNQUALIFY(3pub)
Check Out this Related Man Page
STRSUB(3pub) C Programmer's Manual STRSUB(3pub)NAME
strsub - substitute first occurence of pattern with another string
SYNOPSIS
#include <publib.h>
char *strsub(char *str, const char *pat, const char *sub);
DESCRIPTION
strsub finds the first occurence of the pattern pat in the string str (using a method similar to strstr(3), i.e., no regular expressions),
and replaces it with sub. If pat does not occur in str, no substitution is made.
Of course, if sub is an empty string, the pattern is deleted from the string.
RETURN VALUE
strsub returns a pointer to the first character after the substitution, or NULL if no substitution was made.
EXAMPLE
To substitute up to two occurences of "foo" with "bar" in a line, one might do the following.
p = strsub(line, "foo", "bar");
if (p != NULL)
strsub(line, "foo", "bar");
SEE ALSO publib(3), strstr(3), strgsub(3)AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual STRSUB(3pub)
hello
When i do a "ls -l" in a directory (Aix 5.3), i have the result :
>ls -l
total 65635864
-rw-r--r-- 1 lobi system 2559909888 Feb 20 15:06 cible5.7bdat
-rw-r--r-- 1 lobi system 1020098870 Feb 20 13:06 cible6.7bdat
-rw-r--r-- 1 lobi system 1544789511 Feb 20 11:06 cible9.7bdat
-rw-r--r--... (2 Replies)
hello all,
i have a comma delimited file.
i want to replace the commas in the file with the tilde symbol using sed.
how can i do this?
thanks. (4 Replies)
I have 4 pizza boxes with cent0s installed and each on have a size of 0 when I do an ls and the directory I am concerned about is the /home. I cannot mkdir a directory or file in this /home directory. I get a message similar to this.
mkdir: cannot create directory ..... no such file or... (2 Replies)
Hi Guys,
I have following script which counts number of tilde in file but i want to count tilde which are field saparator.but my script count tilde between word also what i need is if line is like
abcd~das~1212~fsddf~ so tilde count is = 4
if line like
abcd~das~1212~fsd"~"df~ so tilda count... (4 Replies)
Hello Experts,
I need little help with parsing.
I want to parse filename and one level up directory name.
sample $1 will consists of
/home/username/ABC1/rstfiles4.log
/home/username/ABC4/rstfiles2.log
/home/username/EDC7/rstfiles23.log
/home/username/EDC6/rstfiles55.log... (8 Replies)
Hi, I would just like to know how to get the file with the max filename on a directory and get rid of all the others. For example, in directory A:/ i have the ff files:
APPLE2001
APPLE2002
APPLE2003
GRAPE2004
what I want to get is the max in files whose filenames start with APPLE*,... (4 Replies)
I am trying to find the home directory of users on a UNIX (Solaris/AIX) box using
echo ~usernameThis does return the home directory for all valid users. For some reason this command also outputs home directory which are non-existent for few users who seem not to have logon access to that... (31 Replies)
Hi,
I have file where i need to remove only the leading and trailing tilde(~) charaters from file. Please seebelow for sample file:
~~OLD PRODUCT RECORD COUNT ~ 15476~100.00%~~~~~~~~~~~~~~~~~~~~~~~~
~~NEW PRODUCT RECORD COUNT ~ 15609~ 0.85%~~~~~~~~~~~~~~~~~~~~~~~~
~~NEW... (9 Replies)