Cabbage Logo
Back to Cabbage Site

Opcode FileNameFromPath alternative

opcode FileNameFromPath, S, S
S_path xin
i_pos strrindex S_path, “/”
S_name strsub S_path, i_pos + 1
xout S_name
endop

Hi @aspanoz, thanks for posting this, and welcome to the forum. It’s always nice to have native Csound implementations of these things. :+1:

The original function FileNameFromPath did not calculate the filename correctly in osx :slight_smile: And thank you for your titanic work!