in reply to Re: Working with the log files
in thread Working with the log files

Hi,

My problem is I need to create directory where the name of the directory should be name of the current directory it is reading files from. So I am stuck with how to do this. I know I could use mkdir but not sure how to get the dir name:

Directory structure: Main directory/sub directory/ folder 1 , folder 2... After reading the files from sub directory it should generate a output as sub directory/log.txt right now my script is creating only log.txt.

Replies are listed 'Best First'.
Re^3: Working with the log files
by SuicideJunkie (Vicar) on Sep 20, 2010 at 20:28 UTC

    So, are you saying you need to get the name of the Current Working Directory (cwd)?

    Or do you just need to remember which directories you have moved through, in which case a simple array used as a stack would do?

      I need to get the name of the current working directory and create a new directory with that name and place my log file in that directory.

        Did you visit the cwd link? Your post doesn't give the impression that you're off and coding, but you should have everything you need now.