This command lets you handle a file via its IDs

/adm/simul_efun/check_ids.c

#include <std.h>
#include <daemons.h>

varargs string check_ids(string income,int flag) {
    object target;
    string my_file,pre,post;

    if(!target=to_object(income)) { 
        if(!catch(target=present(income,environment(this_player()))) ) {
            target=present(income,environment(this_player())); }
        else if(!catch(target=present(income,this_player()))) {
            target=present(income,this_player()); }}

    if(!target) return income;
    my_file=sscanf(file_name(target),"%s#%s",pre,post) ? pre+".c" :
file_name(target)+".c" ;

    if(explode(my_file,"/")[0]=="std") return income;
    return !flag ? my_file : "/"+implode(explode(my_file,"/")[0..<2],"/") ;
}
