Top Forums Shell Programming and Scripting how to change working directories in perl? Post 88273 by blowtorch on Wednesday 2nd of November 2005 02:05:55 PM
Old 11-02-2005
The function in perl is the same name as the system call - chdir. Check man perlfunc for more details.

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Change permission for directories and files

Is there a way to change subdirectories permission plus the files in the subdirectories in a directory i specified without using the find command? (1 Reply)
Discussion started by: mingfei2006
1 Replies

2. Shell Programming and Scripting

Working with multiple home directories.

I need to rename a directory in every home directory on a given workstation. I am a newb to scripting so maybe thats why I cant exactly figure out how to correctly do this. The first thing I need to be able to do to write this script is figure out how to list all the directorys (these are not... (11 Replies)
Discussion started by: trey85stang
11 Replies

3. UNIX for Dummies Questions & Answers

how to change permissions only to files, not directories....?

Hi, I am really new to unix, any help is much appreciated. I need to change permissions of all files under several subdirectories to 700 but keep directories readable (755). Why ? Because I need a FTP user to only list his files and can't read them. But to browse to subfolder, the directories... (3 Replies)
Discussion started by: narrok
3 Replies

4. UNIX for Dummies Questions & Answers

using dots to change directories

how would i go down a directory using the ../.. (6 Replies)
Discussion started by: JamieMurry
6 Replies

5. Shell Programming and Scripting

Working with directories, need assistance

Hello there, I have the following issue and I need you assistance. I have created a script that searches for directories that have spaces, for example: ./assets/en/images/pricing/current offers/SIMPLE GRID ./assets/en/images/pricing/current offers/ADVERTISED PRICE But now the... (4 Replies)
Discussion started by: jpgleon
4 Replies

6. UNIX for Dummies Questions & Answers

How to get directories colored when doing change directory and tab

I am trying to navigate between directories using cd. However, the only way to distinguish directories now is by seeing the "/' after the directory names, which is quite inefficient. How can I make the directories look in color when typing cd and then using the tab key to list the files and... (1 Reply)
Discussion started by: genehunter
1 Replies

7. UNIX for Dummies Questions & Answers

Change chmod on files in diff directories

I am looking for a small script to crawl through several directories and change a couple of files in each directory to read write status. Anyone have any ideas ? (5 Replies)
Discussion started by: zapper222
5 Replies

8. Shell Programming and Scripting

Perl Script not working on all directories

Hi Folks, I have a script that I am using. The files are in Directory c:\files\change\options In that directory I have many other sub folders like R1 R2 R5 E4 etc... When I run this script in windows, It looks like its just changing the first folder R1 and not the rest. Can I get an... (6 Replies)
Discussion started by: richsark
6 Replies

9. Shell Programming and Scripting

How to change directories?

Hi, I am changing my directory structure /opt/multifamily/restatement/weblogic to /users/saanvi/weblogic Am using sed command to changing the directoried names Please hepme out on this. there is any script to change the directories. Thanks in Advance, (9 Replies)
Discussion started by: saanvi
9 Replies

10. Shell Programming and Scripting

Script to change Permissions on files and directories

Hey, It's me again. Have a problem, that's not really a problem. I have the below script, that goes to the directory I want it to go to. lists out the directories available, lets you choose the directory you want, then it changes the permissions on said directory. using chmod -R and chown -R. ... (2 Replies)
Discussion started by: gkelly1117
2 Replies
IO::Seekable(3pm)					 Perl Programmers Reference Guide					 IO::Seekable(3pm)

IO::Seekable - supply seek based methods for I/O objects SYNOPSIS
use IO::Seekable; package IO::Something; @ISA = qw(IO::Seekable); DESCRIPTION
"IO::Seekable" does not have a constructor of its own as it is intended to be inherited by other "IO::Handle" based objects. It provides methods which allow seeking of the file descriptors. $io->getpos Returns an opaque value that represents the current position of the IO::File, or "undef" if this is not possible (eg an unseekable stream such as a terminal, pipe or socket). If the fgetpos() function is available in your C library it is used to implements getpos, else perl emulates getpos using C's ftell() function. $io->setpos Uses the value of a previous getpos call to return to a previously visited position. Returns "0 but true" on success, "undef" on fail- ure. See perlfunc for complete descriptions of each of the following supported "IO::Seekable" methods, which are just front ends for the corre- sponding built-in functions: $io->seek ( POS, WHENCE ) Seek the IO::File to position POS, relative to WHENCE: WHENCE=0 (SEEK_SET) POS is absolute position. (Seek relative to the start of the file) WHENCE=1 (SEEK_CUR) POS is an offset from the current position. (Seek relative to current) WHENCE=2 (SEEK_END) POS is an offset from the end of the file. (Seek relative to end) The SEEK_* constants can be imported from the "Fcntl" module if you don't wish to use the numbers 0 1 or 2 in your code. Returns 1 upon success, 0 otherwise. $io->sysseek( POS, WHENCE ) Similar to $io->seek, but sets the IO::File's position using the system call lseek(2) directly, so will confuse most perl IO operators except sysread and syswrite (see perlfunc for full details) Returns the new position, or "undef" on failure. A position of zero is returned as the string "0 but true" $io->tell Returns the IO::File's current position, or -1 on error. SEE ALSO
perlfunc, "I/O Operators" in perlop, IO::Handle IO::File HISTORY
Derived from by Graham Barr <> perl v5.8.0 2002-06-01 IO::Seekable(3pm)

Featured Tech Videos

All times are GMT -4. The time now is 10:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy