so i cannot tell you at which line it fails
then please say what is the correct separator in this case. if we really need the separator (despite the fact that we don't really have to rename anything in this example)all parts of a file folder are separated via a single space
$newName = gettoken($folder, 2, " ", , 2); result: nothing happens
$newName = gettoken($folder, 2, ",", , 2); result: nothing happens
$newName = gettoken($folder, 2, "//", , 2); result: nothing happens
$newName = gettoken($folder, 2, "<crlf>", , 2); result: nothing happens
$newName = gettoken($folder, 2, "", , 2); result: Error: The process cannot access the file because it is being used by another process