Creation of directoryname with Max limit


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Creation of directoryname with Max limit
# 1  
Old 11-11-2008
Creation of directoryname with Max limit

Hi,

Please provide your inputs..


# define PATH_MAX 1023 /* max number of characters in a pathname (not including terminating null) */


Could you please let me know how to create directory name(or pathname) with above PATH_MAX length in korn shell scripting..

Thanks in Advance,
Mansa
# 2  
Old 11-11-2008
You should also do "getconf -a |grep PATH_MAX" to see the actual limit. Whatever that limit is, it's unlikely you can do anything to do to get around that. (While some commands might work, there's no guarantee the OS will.)
# 3  
Old 11-11-2008
ENAMETOOLONG is the error returned when you attempt to access a file or directory that
has a path name that is too long. Are you trying to create a path like that?
# 4  
Old 11-11-2008
yes jim mcnamara ..


I am trying to create PATH such that i must receive "ENAMETOOLONG" error..

Please let me know how to create it..

Thanks in Advance,
Mansa
# 5  
Old 11-11-2008
If you have some deep directory trees, try adding a symbolic link from the bottom of one tree to the top of another directory tree. Referencing a file way down on the second tree via the full name of the first tree + link > directory name of second tree

Are you trying to secure files?
# 6  
Old 11-11-2008
Hi Jim mcnamara,


As i am poor at scripting.. Could you please send me in the form of script that helps me alot...

And i am going to use that pathname(which is too long) as first argument in statvfs systemcall...

int statvfs (const char *path, struct statvfs *buf);


Thanks,
Mansa
# 7  
Old 11-11-2008
So you WANT a path that is too long?

Code:
cd /tmp
while true; do
  mkdir TEST 
  cd TEST || break
done
pwd
rm -rf /tmp/TEST

The output will be the name of the long directory.

If your shell is buggy, the script won't end properly. It will start producing error messages. Just hit CTRL-C (break) and type 'pwd' manually.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Ubuntu

Max Open File Limit

Ubuntu users, I am configuring an Ubuntu 14.04 server as a load injector. I have appended the hard and soft limits to /etc/security/limits.conf for any user (apart from root): * hard nofile 65536 * soft nofile 65536 I am seeing the figure 65536 in... (5 Replies)
Discussion started by: aidylewis
5 Replies

2. Solaris

Limit: stacksize: Can't remove limit

Hi all, I'm using to Solaris machine. When I run a simple script this messenger come out:"limit: stacksize: Can't remove limit". Any one know the way to resolve this problem without reboot the machine? Thanks in advance. (3 Replies)
Discussion started by: Diabolist9
3 Replies

3. HP-UX

max limit in in setting array

hi, iam getting error when i assign a variable to an array of more that 315 character in length set -A array <variable> <variable> value is 000001 000002 and up to 000045 it is giving error as "The specified subscript cannot be greater than 1024." can any one help me to solve this (2 Replies)
Discussion started by: gomathi
2 Replies

4. Shell Programming and Scripting

cutting unix path after known directoryname

Hi scripters, I know sed can do this, but I'm not to well trained to achieve this. Problem: wherever I am in my filesystem, with a 'pwd' I can check where I am. It may be "/usr/local/apache/etc/conf" or "/opt/apache/var/log/backup" or "/var/log/backup/apache/2009/december" Now from these... (7 Replies)
Discussion started by: Qube
7 Replies

5. Linux

file-max limit

Oct 31 00:00:02 FIREWALL003 syslogd 1.4.1: restart. Oct 31 00:00:02 FIREWALL003 syslogd 1.4.1: restart. Oct 31 00:00:02 FIREWALL003 syslogd 1.4.1: restart. Oct 31 02:37:09 FIREWALL003 kernel: srmLINUX: segfault at 00000000303a3031 rip 000000000026fe54 rsp 00000000ffbd05b8 error 4 Oct 31... (5 Replies)
Discussion started by: itik
5 Replies

6. Programming

How to limit max no of message in a posix message queue

Hii can anyone pls tell how to limit the max no of message in a posix message queue. I have made changes in proc/sys/fs/mqueue/msg_max But still whenever i try to read the value of max. message in the queue using attr.mq_curmsgs (where struct mq_attr attr) its giving the default value as 10.... (0 Replies)
Discussion started by: mohit3884
0 Replies

7. Shell Programming and Scripting

TCL Socket max Limit settting

How to set the max limit for socket opening TCL Thanks, Ajay (1 Reply)
Discussion started by: aju_kup
1 Replies

8. Shell Programming and Scripting

Max NO of parameters

1> Can anyone tell me what is the maximum no of parameters that can be passed to a file 2> i have 100 files amongst which in 500 files i have a string which needs to be searched how would get the names of those files. (1 Reply)
Discussion started by: Shivdatta
1 Replies

9. Shell Programming and Scripting

max value

Hi All, I want to choose the maximum value from a column values. eg - 234 23 567 43 2456 5 678 8978 from thses values how to choose the max value ? thanks. roger. (3 Replies)
Discussion started by: Nayanajith
3 Replies
Login or Register to Ask a Question