1

I want to know what the current directory is. I don't want to shell out to run pwd. Is there an easy way to do this in Dart? and also, Is there a way, put name of directory into a string?

davidtra
  • 11
  • 1

1 Answers1

2

Re the current directory, from the documentation from the Directory class in dart:io (emphasis added).

In addition to being used as an instance to access the file system, Directory has a number of static properties, such as systemTemp, which gets the system's temporary directory, and the getter and setter current, which you can use to access or change the current directory.

To get the name of a Directory as a string just use toString(), or perhaps the path property.

Argenti Apparatus
  • 3,857
  • 2
  • 25
  • 35