in reply to chdir not working

btw, if $cwd contains the current work directory,

my $path_data = $cwd."\\data"; chdir($path_data)
is the same as
my $path_data = "data"; chdir($path_data)

Replies are listed 'Best First'.
Re^2: chdir not working
by Anonymous Monk on Mar 14, 2011 at 21:57 UTC

    Can I make it can-insensitive?for example am trying to append "data",if the directory contains "DATA",will windows be able to find it?

      The Windows OS file system is case-preserving but case-insensitive.

      c:\>cd @wOrK\PeRl c:\@Work\Perl> c:\@Work\Perl>dir uPD* Volume in drive C is Acer Volume Serial Number is 1234-5678 Directory of c:\@Work\Perl 02/13/2010 07:57 PM 4,098 Updfxgen.pl 02/13/2010 07:57 PM 3,956 Updfxgen.pl1 02/13/2010 07:57 PM 33,199 updgen.pl 02/13/2010 07:57 PM 1,732 Updungen.pl 02/13/2010 07:57 PM 1,589 Updungen.pl1 5 File(s) 44,574 bytes 0 Dir(s) 256,281,104,384 bytes free

      Update: Expanded the example. Also: Perl commands for the Windows API (not for the command line!) accept a / (forward slash) just as well as a \ (backslash), alleviating the need to escape backslashes in double-quoted strings.

      If the file system is case-insensitive, then chdir('data'), chdir('Data'), chdir('DATA'), etc will all switch to your data directory, however it was named at creation.

      If the file system is case-sensitive, then only one of chdir('data'), chdir('Data'), chdir('DATA'), etc will switch to your data directory.

Re^2: chdir not working
by Anonymous Monk on Mar 14, 2011 at 22:36 UTC

    This is not working for me,am using 5.6.1,does that make a difference?

    On a side note,how do I update my previous replies

      You can't update your previous replies. You are Anonymous Monk which has the small advantage of not needing to register or log on, but has many disadvantages too like not being able to edit your nodes or being advised when someone has replied to one of your nodes.

      True laziness is hard work
      You need to have been logged in when you made the post. Otherwise, anyone would be able to update any anonymous post.
Re^2: chdir not working
by Anonymous Monk on Mar 14, 2011 at 22:32 UTC

    This is not working for me,am using 5.6.1,does that make a difference?

      What do you mean by not working? I didn't say either would work; I said they were the same. Do you mean they're not the same for you? If so, why do you think they are different?
Re^2: chdir not working
by Anonymous Monk on Mar 14, 2011 at 22:38 UTC

    This is not working for me,am using 5.6.1,does that make a difference?