Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Length of a Unix filepath max length Post 99858 by wilsontan on Wednesday 22nd of February 2006 02:28:01 AM
Old 02-22-2006
Quote:
Originally Posted by jim mcnamara
pathconf returns PATH_MAX. It can vary with the implementation and on the same box within filesytems.

For example:
POSIX: PATH_MAX is 255 without the terminating NULL.
SVID2: PATH_MAX is 1023 without the terminating NULL.
Hi Jim,

How do i obtain it in Solaris ? Is it a echo $PATHCONF ?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

what is the max length of args i can pass in shell?

i have a shell script which takes several args. what is the maximum length of string i can give as argument? (6 Replies)
Discussion started by: senthilk615
6 Replies

2. UNIX for Dummies Questions & Answers

Read file and remove max length

Hi all, I tried to write a shell to read huge file and eliminate max length record which is wrong generated record. But I get an error remove_sp.sh: line 27: syntax error near unexpected token `else' remove_sp.sh: line 27: ` else $LINE >> REJFILE' My shell is here: #!/bin/sh... (5 Replies)
Discussion started by: mr_bold
5 Replies

3. Shell Programming and Scripting

Counting the max length of string

Hi all, I have a flat file of 1000 rows. I want to check the length of the 5th column. The one having the longest length , I want to set it as DEFINED PARAMETER. So later I can check others with that particular number only. Any ideas ?? (2 Replies)
Discussion started by: ganesh123
2 Replies

4. Shell Programming and Scripting

how to grep the max length word form a file?

Hi i have a requirement that is extract the max length word from a file ? plz reply (2 Replies)
Discussion started by: vankireddy
2 Replies

5. Programming

key_t type max length or boundaries value

Hello, In shared memory, when using shmget function, first parameter is ket_t key. I know it is an integer type, but length of it is system dependent. That means may not be have integer's ranges. What is range of key_t in Linux? Is it different in distros, for example in ubuntu & fedora? (2 Replies)
Discussion started by: pronetin
2 Replies

6. UNIX for Advanced & Expert Users

How to increase max username length?

Hi, This is my first post to this site. So kindly forgive if I am writing in a wrong section. My query is that... I want to modify the max username length size. I guess it is 32/64 on CentOS. Now I want to change it to 128. Is there any way to do that? Thanks in advance!! :) (4 Replies)
Discussion started by: ajay303
4 Replies

7. UNIX for Dummies Questions & Answers

Modify the max username length

Hey Any one... Do u know any way I can modify the max username length in unix? I guess it is 32/64 characters by default. Suppose I want to increase it to 128. i hav tried /etc/skel but no use... How can I do that? (2 Replies)
Discussion started by: MayureshRisbud
2 Replies

8. Shell Programming and Scripting

Filter (by max length) only lines not matching regex

I have a large file of many pairs of sequences and their headers, which always begin with '>' I'm looking for help on how to retain only sequences (and their headers) below a certain length. So if min length was 10, output would be I can filter by length, but I'm not sure how to exclude... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

9. Shell Programming and Scripting

Find max length of the field and then replace zero

hai guys, pick the 1st field and calculate max length. if suppose max length is 2, then compare the all records if <2 then add zero's prefix of the record. for ex: s.no,sname 1,djud 37,jtuhe in this max length of the 1st field is 2 right the output wil be s.no,sname 01,djud... (6 Replies)
Discussion started by: Suneelbabu.etl
6 Replies
REALPATH(3)						     Linux Programmer's Manual						       REALPATH(3)

NAME
realpath - return the canonicalized absolute pathname SYNOPSIS
#include <limits.h> #include <stdlib.h> char *realpath(const char *path, char *resolved_path); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): realpath(): _BSD_SOURCE || _XOPEN_SOURCE >= 500 DESCRIPTION
realpath() expands all symbolic links and resolves references to /./, /../ and extra '/' characters in the null-terminated string named by path to produce a canonicalized absolute pathname. The resulting pathname is stored as a null-terminated string, up to a maximum of PATH_MAX bytes, in the buffer pointed to by resolved_path. The resulting path will have no symbolic link, /./ or /../ components. If resolved_path is specified as NULL, then realpath() uses malloc(3) to allocate a buffer of up to PATH_MAX bytes to hold the resolved pathname, and returns a pointer to this buffer. The caller should deallocate this buffer using free(3). RETURN VALUE
If there is no error, realpath() returns a pointer to the resolved_path. Otherwise it returns a NULL pointer, and the contents of the array resolved_path are undefined, and errno is set to indicate the error. ERRORS
EACCES Read or search permission was denied for a component of the path prefix. EINVAL Either path or resolved_path is NULL. (In libc5 this would just cause a segfault.) But, see NOTES below. EIO An I/O error occurred while reading from the file system. ELOOP Too many symbolic links were encountered in translating the pathname. ENAMETOOLONG A component of a pathname exceeded NAME_MAX characters, or an entire pathname exceeded PATH_MAX characters. ENOENT The named file does not exist. ENOTDIR A component of the path prefix is not a directory. VERSIONS
On Linux this function appeared in libc 4.5.21. CONFORMING TO
4.4BSD, POSIX.1-2001. POSIX.1-2001 says that the behavior if resolved_path is NULL is implementation-defined. POSIX.1-2008 specifies the behavior described in this page. NOTES
In 4.4BSD and Solaris the limit on the pathname length is MAXPATHLEN (found in <sys/param.h>). SUSv2 prescribes PATH_MAX and NAME_MAX, as found in <limits.h> or provided by the pathconf(3) function. A typical source fragment would be #ifdef PATH_MAX path_max = PATH_MAX; #else path_max = pathconf(path, _PC_PATH_MAX); if (path_max <= 0) path_max = 4096; #endif (But see the BUGS section.) The 4.4BSD, Linux and SUSv2 versions always return an absolute pathname. Solaris may return a relative pathname when the path argument is relative. The prototype of realpath() is given in <unistd.h> in libc4 and libc5, but in <stdlib.h> everywhere else. BUGS
The POSIX.1-2001 standard version of this function is broken by design, since it is impossible to determine a suitable size for the output buffer, resolved_path. According to POSIX.1-2001 a buffer of size PATH_MAX suffices, but PATH_MAX need not be a defined constant, and may have to be obtained using pathconf(3). And asking pathconf(3) does not really help, since, on the one hand POSIX warns that the result of pathconf(3) may be huge and unsuitable for mallocing memory, and on the other hand pathconf(3) may return -1 to signify that PATH_MAX is not bounded. The resolved_path == NULL feature, not standardized in POSIX.1-2001, but standardized in POSIX.1-2008, allows this design problem to be avoided. The libc4 and libc5 implementation contains a buffer overflow (fixed in libc-5.4.13). Thus, set-user-ID programs like mount(8) need a pri- vate version. SEE ALSO
readlink(2), canonicalize_file_name(3), getcwd(3), pathconf(3), sysconf(3) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2009-02-23 REALPATH(3)
All times are GMT -4. The time now is 07:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy