Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fchdir(2) [hpux man page]

chdir(2)							System Calls Manual							  chdir(2)

NAME
chdir, fchdir - change working directory SYNOPSIS
DESCRIPTION
and cause a directory pointed to by path or fildes to become the current working directory, the starting point for path searches of path names not beginning with path points to the path name of a directory. fildes is an open file descriptor of a directory. For a directory to become the current working directory, a process must have execute (search) access to the directory. RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and is set to indicate the error. ERRORS
fails and the current working directory remains unchanged if one or more of the following are true: A component of the path name is not a directory. The named directory does not exist. Search permission is denied for any component of the path name. path points outside the allocated address space of the process. The reliable detection of this error is implemen- tation dependent. path is null. The length of the specified path name exceeds bytes, or the length of a component of the path name exceeds bytes while is in effect. Too many symbolic links were encountered in translating the path name. fails and the current working directory remains unchanged if one or more of the following are true: Search permission is denied for fildes. fildes is not an open file descriptor. The open file descriptor fildes does not refer to a directory. AUTHOR
and were developed by AT&T Bell Laboratories and HP. SEE ALSO
cd(1), chroot(2), privileges(5). STANDARDS CONFORMANCE
chdir(2)

Check Out this Related Man Page

chdir(2)							System Calls Manual							  chdir(2)

NAME
chdir, fchdir - change working directory SYNOPSIS
DESCRIPTION
and cause a directory pointed to by path or fildes to become the current working directory, the starting point for path searches of path names not beginning with path points to the path name of a directory. fildes is an open file descriptor of a directory. For a directory to become the current working directory, a process must have execute (search) access to the directory. RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and is set to indicate the error. ERRORS
fails and the current working directory remains unchanged if one or more of the following are true: A component of the path name is not a directory. The named directory does not exist. Search permission is denied for any component of the path name. path points outside the allocated address space of the process. The reliable detection of this error is implemen- tation dependent. path is null. The length of the specified path name exceeds bytes, or the length of a component of the path name exceeds bytes while is in effect. Too many symbolic links were encountered in translating the path name. fails and the current working directory remains unchanged if one or more of the following are true: Search permission is denied for fildes. fildes is not an open file descriptor. The open file descriptor fildes does not refer to a directory. AUTHOR
and were developed by AT&T Bell Laboratories and HP. SEE ALSO
cd(1), chroot(2), privileges(5). STANDARDS CONFORMANCE
chdir(2)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

path

This is my path for a directory in AIX /oracle/ab/xx/yy/data/ i dont want to type this everytime at the prompt. instead call the path using say cd call (6 Replies)
Discussion started by: thumsup9
6 Replies

2. UNIX for Dummies Questions & Answers

Change to a new working directory...

I need to CD to a particular directory to check log files and interface files. Instead of typing the path manually, is there a way of getting a script to change my working directory to the one I need? Currently I have a script that CD's to the directories I need but a soon as the script exits,... (5 Replies)
Discussion started by: jagannatha
5 Replies

3. Shell Programming and Scripting

cd command not working

Hello, I am facing a strange problem while writing a script in ksh .... though the script is too long but whenever i try to change the path to new path , the path is not changed... like the path is : ?pwd /osp/linus ?more script echo "hello" cd /osp echo "bye" ?sh script hello... (7 Replies)
Discussion started by: er_aparna
7 Replies

4. UNIX for Dummies Questions & Answers

Name of path

I can't see the name of the directory path when i connect to server with telnet. What can i do? Thanks. Example: #cd directory1 #cd directory2 #cd directory3 #_ (current directory is directory3) but i want this #cd directory1 #directory1> cd directory2... (8 Replies)
Discussion started by: mehmetned
8 Replies

5. UNIX for Dummies Questions & Answers

How to change current working directory for dbx on UNIX?

How to change current working directory for dbx on UNIX? means I'll run pgm from one directory , but getcwd() should return path which I want to be, which is not d current dir :) (5 Replies)
Discussion started by: login0001
5 Replies

6. UNIX for Dummies Questions & Answers

How to get the path of a file in UNIX?

Hi Frindz, I want to get the entire path of a file. I am in root directory and i know the file name, However dont know the path where it is. Please tell me the command to get the entire path for the file? Thanks in advance, Rashmy. (14 Replies)
Discussion started by: smr_rashmy
14 Replies

7. Programming

Determining file access perms for current process

Stupid question, but is there an ANSI C stdlib function that will do this for me? I want to pass the function a path and determine if the current process can read/write/execute on the path. I suppose I can whip something up using fstat and then determining the current process's user/group IDs and... (6 Replies)
Discussion started by: DreamWarrior
6 Replies

8. Programming

help with printing file names in current directory for C

How do I print all the file names in current directory in C? (6 Replies)
Discussion started by: omega666
6 Replies

9. UNIX for Dummies Questions & Answers

Career path help

I am working in a company in which my work includes working on Linux nodes. The "uname -arv" command outputs - "Linux clx28ap01 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux". I generally use various command to stop/start the servers, checking space,... (7 Replies)
Discussion started by: csrohit
7 Replies

10. Red Hat

Empty directory, large size and performance

Hi, I've some directory that I used as working directory for a program. At the end of the procedure, the content is deleted. This directory, when I do a ls -l, appears to still take up some space. After a little research, I've seen on a another board of this forum that it's not really taking... (5 Replies)
Discussion started by: bdx
5 Replies

11. OS X (Apple)

Compiling fails due to space in path to home folder

I seem to have issues compiling software and I think I've narrowed it down to something having to do with having a space in the path name to my Home folder (which contains "Macintosh HD"). The reason I think this is shown here: $ echo $HOME /Volumes/Macintosh HD/Users/Tom $ cd $HOME -sh:... (7 Replies)
Discussion started by: tdgrant1
7 Replies

12. Shell Programming and Scripting

How to get the directory name from a path using csh?

Hi, I want to get ABC and 924 from this path. How can i do so? The length of the path can vary from but end will we same. /home/abs/cad/bad_BAD/vdhingra/testcases/ABC/924/work Similarly, CBA and 234 from this path. /home/abs/cad/aaa/bad_BAD/vdhingra/testcases/CBA/234/work (5 Replies)
Discussion started by: vdhingra123
5 Replies

13. Shell Programming and Scripting

Tar file

I need to create a tar file by taking my scripts from different directories. Also once I created the tar file, if I need to append some more files from different directories what is the command I need to use. Can some one help me please (8 Replies)
Discussion started by: ginrkf
8 Replies

14. Solaris

Find path of executable having problem

Hi cannot find the path to a running process on a host. I looked and tried some suggestions in forums to no avail. can someone please help? I need to know where this process is starting from as we have several versions in multiple directories --------- Process name 1201 1 0 Feb 14 ?... (14 Replies)
Discussion started by: mnassiri
14 Replies

15. What is on Your Mind?

UNIX career path for Admin

Hello, Just wanted to have a suggestion on UNIX carrier path and I couldn't found any proper forum/blog where I can put this question better than this one. I have been working on Solaris from past 13 years and some years on Linux. It was completely on Admin side and never on development or... (12 Replies)
Discussion started by: solaris_1977
12 Replies