createTempFile function
- @Deprecated('Avoid creating temporary files in the default temp location ' 'with this function due to too wide permissions on the newly created file. ' 'Use kotlin.io.path.createTempFile instead or resort to java.io.File.createTempFile.')
Creates a new empty file in the specified directory,
using the given prefix and suffix to generate its name.
Implementation
@Deprecated(
'Avoid creating temporary files in the default temp location '
'with this function due to too wide permissions on the newly created file. '
'Use kotlin.io.path.createTempFile instead or resort to java.io.File.createTempFile.',
)
File createTempFile({
String prefix = 'tmp',
String? suffix,
File? directory,
}) {
return File(
'${directory?.path ?? ''}/$prefix${suffix ?? ''}',
);
}