-2

After writing out a file I want to know where it is, if i use dir i get the files in the current folder but i just want the current folder and dirname is a little obscure

Assuming

C\foldername\subfolder1
            \subfolder2
            \subfolder3
                      \file1
                      \file2

If r is running in sub folder 3 I will get

[1] "file1"                                         
[2] "file2"

I want a command that will tell me C:\foldername\subfolder3

user1605665
  • 3,771
  • 10
  • 36
  • 54

1 Answers1

1

Use getwd to get the current working directory.

fishtank
  • 3,718
  • 1
  • 14
  • 16