www.delorie.com/djgpp/doc/libc/libc_733.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

__solve_dir_symlinks

Syntax

 
#include <libc/symlink.h>

int __solve_dir_symlinks(const char *symlink_path, char *real_path);

Description

This function resolves given symlink in symlink_path---all path components except the last one and all symlink levels are resolved. If symlink_path does not contain symlinks at all, it is simply copied to real_path.

real_path should be of size FILENAME_MAX, to contain the maximum possible length of path.

Return Value

Zero in case of error (and errno set to the appropriate error code), non-zero in case of success.

Portability

ANSI/ISO C No
POSIX No

Example

 
  #include <libc/symlink.h>
  #include <stdio.h>

  char fn[] = "c:/somelink/someotherlink/somefile";
  char file_name[FILENAME_MAX];

  __solve_dir_symlinks(fn, file_name);
  printf("The real path to %s is %s\n", fn, file_name);


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004