3 # This library is no longer being maintained, and is included for backward
4 # compatibility with Perl 4 programs which may require it.
5 # This legacy library is deprecated and will be removed in a future
8 # In particular, this should not be used as an example of modern Perl
9 # programming techniques.
11 # Suggested alternative: Cwd
13 # Usage: $cwd = &fastcwd;
15 # This is a faster version of getcwd. It's also more dangerous because
16 # you might chdir out of a directory that you can't chdir back into.
19 local($odev, $oino, $cdev, $cino, $tdev, $tino);
23 ($cdev, $cino) = stat('.');
25 ($odev, $oino) = ($cdev, $cino);
27 ($cdev, $cino) = stat('.');
28 last if $odev == $cdev && $oino == $cino;
36 ($tdev, $tino) = lstat($_);
37 last unless $tdev != $odev || $tino != $oino;
42 chdir($path = '/' . join('/', @path));