FilesGetNextFileName Method
Returns path if a file with specified name does not exist yet.
Otherwise, returns the first non-existing file name with a number postfix.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.0.0
public static string? GetNextFileName(
string path,
string? postfixSeparator = null
)
Public Shared Function GetNextFileName (
path As String,
Optional postfixSeparator As String = Nothing
) As String
public:
static String^ GetNextFileName(
String^ path,
String^ postfixSeparator = nullptr
)
static member GetNextFileName :
path : string *
?postfixSeparator : string
(* Defaults:
let _postfixSeparator = defaultArg postfixSeparator null
*)
-> string
- path String
- Full path of the file to check.
- postfixSeparator String (Optional)
- A postfix between the file name and the numbering. This parameter is optional.
Default value: .
StringReturns
path, if that is a non-existing file name. Returns
, if
path denotes a root directory.
Otherwise, returns a non-existing file name with a number postfix in the file name part (the extension will not be changed).