hi everyone
i have a
gchar *path = /home/tom/somefile.gz;
and i wants to get the path to that file.. (in this example ('/home/tom'
or '/home/tom/')..
is there a function ?
or how can i do that ?
thanks
tom
i have a
gchar *path = /home/tom/somefile.gz;
and i wants to get the path to that file.. (in this example ('/home/tom'
or '/home/tom/')..
is there a function ?
or how can i do that ?
thanks
tom
> i have a
> gchar *path = /home/tom/somefile.gz;
> and i wants to get the path to that file.. (in this example ('/home/tom' or
> '/home/tom/')..
> is there a function ?
> or how can i do that ?
HTH, Dragan
--
Dragan Cvetkovic,
To be or not to be is true. G. Boole No it isn't. L. E. J. Brouwer
--
"Last I checked, it wasn't the power cord for the Clue Generator that
was sticking up your ass." - John Novak, rasfwrj
| i have a
| gchar *path = /home/tom/somefile.gz;
| and i wants to get the path to that file.. (in this example ('/home/tom'
| or '/home/tom/')..
| is there a function ?
| or how can i do that ?
I don't know what you are asking. If you already have the path of the
file as in that first statement, then what are you trying to get? Are
you trying to just extract the path of the parent directory, such as
with:
char parent[PATH_MAX];
strncpy(parent,PATH_MAX-1,path);
parent[PATH_MAX-1]=0;
if((p=strrchr(parent,'/')))*p=0;
--
-----------------------------------------------------------------
| Phil Howard - KA9WGN | Dallas | http://linuxhomepage.com/ |
-----------------------------------------------------------------
> > man dirname(3).
> dirname() might not be sufficiently portable, in which case you can
> always implement it using strrchr(the_path, "/").
Bye, Dragan
--
Dragan Cvetkovic,
To be or not to be is true. G. Boole No it isn't. L. E. J. Brouwer
1. Secure CGI Path Access (translate file path "/" to user homedir)
Hi,
i just configured my webserver (apache) with suexec, so CGI
Scripts are executed with the users uid. Now i do only want
the users CGI Scripts to have access inside their homedir
("/home/www/userdir"). How do i prevent the CGI Scripts from
accessing files like "/etc/httpd/httpd.conf" without changing
all file permissions.
Is there a solution for the setting a virtual User Root Dir
"/" to "/home/www/userdir" ?
PS: Users have no shell Access...
Thanks, Niemo.
3. C: get absolute path to a file from relative path
5. automatically adding paths to $PATH in startup files
7. add in the PATH a path if not present in the PATH
8. How do i get text from a Window to another.
9. ksh: add path to $PATH only when ot yet in $PATH
10. zsh's 'typeset -U path' wipes out path/PATH
11. PATH=$(getconf PATH), but PATH for getconf?
12. set path = "$path" hoses path in tcsh -- why???
13. How to expand paths in $PATH like "~/bin" to full path?