createTempDir function

  1. @Deprecated('Avoid creating temporary directories in the default temp location ' 'with this function due to too wide permissions on the newly created directory. ' 'Use kotlin.io.path.createTempDirectory instead.')
Directory createTempDir({
  1. String prefix = 'tmp',
  2. String? suffix,
  3. File? directory,
})

Creates an empty directory in the specified directory, using the given prefix and suffix to generate its name.

Implementation

@Deprecated(
  'Avoid creating temporary directories in the default temp location '
  'with this function due to too wide permissions on the newly created directory. '
  'Use kotlin.io.path.createTempDirectory instead.',
)
Directory createTempDir({
  String prefix = 'tmp',
  String? suffix,
  File? directory,
}) {
  return Directory.systemTemp.createTempSync(
    '${directory?.path ?? ''}/$prefix${suffix ?? ''}',
  );
}