mkdir: A file or path name is too long


 
Thread Tools Search this Thread
Operating Systems AIX mkdir: A file or path name is too long
# 1  
Old 08-10-2006
mkdir: A file or path name is too long

Hi,

I have an AIX machine. I am trying to create a directory from within the script, but the message being shown is "mkdir: 0653-358 Cannot create directory 'xxx': A file or path name is too long"

I am not giving any 'long' pathname to mkdir. The commands being issued within the script are:

cd /abc/def/egh
mkdir ijk

mkdir is failing to create 'ijk' because 'A file or path name is too long'

Any ideas why this is happening? Any help will be greatly appreciated.

- Greenhorn
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Switching between directories and mkdir/copy dir/file

I was trying to copy the files inside the path /home/user/check/Q1/dir/folder1/expected/n/a1.out1 and a1.out2 and a1.out3 to /home/user/check/Q2/dir/folder1/expected/n/ if n directory is not present at Q2/dir/folder1/expected/ then directory should be created first. And, script follow the... (5 Replies)
Discussion started by: Mannu2525
5 Replies

2. Shell Programming and Scripting

Use script to mkdir based on file's data

I have a file with lines like: 111 12 7 111 13 8 112 12 9 115 31 3 120 31 9 123 10 7 125 12 I want to make a script which, split the first column into parts (101-110, 111-120...), and make directories for its part with name (101-110, 111-120...) Also i want in every directory include... (7 Replies)
Discussion started by: efsarantis
7 Replies

3. Shell Programming and Scripting

How to create a long list of directories with mkdir?

Hi... Thanks to read this... I want to use mkdir to create many directories listed in a text file, let's say. How do I do this? Sorry for this maybe very basic question :) (13 Replies)
Discussion started by: setub
13 Replies

4. Shell Programming and Scripting

Copy of "How to create a long list of directories with mkdir?"

To bakunin and corona688: My result when text in file is ms_ww_546 ms_rrL_99999 ms_nnn_67_756675 is https://www.unix.com/C:\Users\Fejoz\Desktop\ttt.jpg I hope you can see the picture. There is like a "whitespace character" after 2 of the 3 created directories. ---------- Post... (0 Replies)
Discussion started by: setub
0 Replies

5. Shell Programming and Scripting

Long PATH, LD_LIBRARY_PATH, LIBPATH, … – what kind of performance impact do they have?

Hi, there! a long PATH... makes the OS access the disk quite often, hence there is a lot of disk I/O a long PATH... makes the OS compute a lot of ..., hence a high CPU load (Edited/added later: Yes, this is not about the lenght of the env. var., but about the number of directories listed.)... (1 Reply)
Discussion started by: Jochen_Hayek
1 Replies

6. Shell Programming and Scripting

0403-035 specified path name too long

I get this error when attempting to run a simple .ksh script. This script runs fine on other servers. What causes this error? (3 Replies)
Discussion started by: ivanachukapawn
3 Replies

7. Shell Programming and Scripting

specified path name is too long passing parameters to awk via shell script

Hello, I have this shell script that runs awk code by passing in parameters however now it doesn't work anymore with the parameters and I don't know why. It removes duplicates from an input file based on a part of the last field and a key column. It removes the record with the older datetime... (0 Replies)
Discussion started by: script_op2a
0 Replies

8. Windows & DOS: Issues & Discussions

Long UNC path not working in CMD.EXE on remote machine

Hi, I am trying to connect to a remote server using Plink tool. Both my local and remote machines are Windows. On remote server, I have OpenSSH server installed. I am able to run commands on remote machine but there is some problem with long UNC path, which I noticed today. For... (3 Replies)
Discussion started by: Technext
3 Replies

9. Programming

lstat long path problem

Hi, We are using lstat in our project. But in case of the path length more than 1024, it's returning error ENAMETOOLONG. Is there any another system call which is supporting more than 1024 path and providing the same info as lstat. Thanks (2 Replies)
Discussion started by: Saurabh78
2 Replies
Login or Register to Ask a Question
mkdir(2)							   System Calls 							  mkdir(2)

NAME
mkdir - make a directory SYNOPSIS
#include <sys/types.h> #include <sys/stat.h> int mkdir(const char *path, mode_t mode); DESCRIPTION
The mkdir() function creates a new directory named by the path name pointed to by path. The mode of the new directory is initialized from mode (see chmod(2) for values of mode). The protection part of the mode argument is modified by the process's file creation mask (see umask(2)). The directory's owner ID is set to the process's effective user ID. The directory's group ID is set to the process's effective group ID, or if the S_ISGID bit is set in the parent directory, then the group ID of the directory is inherited from the parent. The S_ISGID bit of the new directory is inherited from the parent directory. If path names a symbolic link, mkdir() fails and sets errno to EEXIST. The newly created directory is empty with the exception of entries for itself (.) and its parent directory (..). Upon successful completion, mkdir() marks for update the st_atime, st_ctime and st_mtime fields of the directory. Also, the st_ctime and st_mtime fields of the directory that contains the new entry are marked for update. RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned, no directory is created, and errno is set to indicate the error. ERRORS
The mkdir() function will fail if: EACCES Either a component of the path prefix denies search permission or write permission is denied on the parent directory of the directory to be created. EDQUOT The directory where the new file entry is being placed cannot be extended because the user's quota of disk blocks on that file system has been exhausted; the new directory cannot be created because the user's quota of disk blocks on that file system has been exhausted; or the user's quota of inodes on the file system where the file is being created has been exhausted. EEXIST The named file already exists. EFAULT The path argument points to an illegal address. EINVAL An attempt was made to create an extended attribute that is a directory. EIO An I/O error has occurred while accessing the file system. ELOOP Too many symbolic links were encountered in translating path. ELOOP A loop exists in symbolic links encountered during resolution of the path argument. EMLINK The maximum number of links to the parent directory would be exceeded. ENAMETOOLONG The length of the path argument exceeds PATH_MAX, or the length of a path component exceeds NAME_MAX while _POSIX_NO_TRUNC is in effect. ENOENT A component of the path prefix does not exist or is a null pathname. ENOLINK The path argument points to a remote machine and the link to that machine is no longer active. ENOSPC No free space is available on the device containing the directory. ENOTDIR A component of the path prefix is not a directory. EROFS The path prefix resides on a read-only file system. The mkdir() function may fail if: ENAMETOOLONG As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}. EXAMPLES
Example 1: Create a directory. The following example demonstrates how to create a directory named /home/cnd/mod1, with read, write, and search permissions for owner and group, and with read and search permissions for others. #include <sys/types.h> #include <sys/stat.h> int status; ... status = mkdir("/home/cnd/mod1", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe | +-----------------------------+-----------------------------+ SEE ALSO
chmod(2), mknod(2), umask(2), mkdirp(3GEN), stat.h(3HEAD), attributes(5), standards(5) SunOS 5.10 29 Jul 2004 mkdir(2)