MCPcopy Create free account
hub / github.com/aldostools/webMAN-MOD / folder_listing

Function folder_listing

include/file_manager.h:601–1172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

599}
600
601static bool folder_listing(char *buffer, u32 BUFFER_SIZE_HTML, char *html, char *param, int conn_s, char *tempstr, char *header, u8 is_ps3_http, s8 sort_by, s8 sort_order, char *file_query)
602{
603 int fd; t_string sout; _set(&sout, buffer, strlen(buffer));
604
605 CellRtcDateTime rDate; char *full_path = html, *html2 = tempstr;
606
607 if(sys_admin && islike(param, "/dev_blind?"))
608 {
609 if( param[11] & 1) enable_dev_blind(NO_MSG); else //enable
610 if(~param[11] & 1) disable_dev_blind(); //disable
611
612 if( param[11] ) {sprintf(html, HTML_REDIRECT_TO_URL, "/", HTML_REDIRECT_WAIT); _concat(&sout, html);}
613
614 _concat2(&sout, "/dev_blind: ", isDir("/dev_blind") ? STR_ENABLED : STR_DISABLED);
615 return true;
616 }
617
618 normalize_path(param, false);
619
620 absPath(full_path, param, "/"); // auto mount /dev_blind & /dev_hdd1
621
622 u8 is_net = (param[1] == 'n'), skip_cmd = 0;
623
624 bool is_ntfs = false;
625
626 int plen = strlen(param);
627 bool is_root = (plen < 4);
628
629 #ifdef USE_NTFS
630 struct stat bufn;
631 DIR_ITER *pdir = NULL;
632 char *npath = NULL;
633
634 is_ntfs = is_ntfs_path(param);
635 if((is_root && root_check) | is_ntfs) check_ntfs_volumes();
636
637 if(is_ntfs)
638 {
639 npath = (char*)ntfs_path(param); // /dev_ntfs1v -> ntfs1:/
640 pdir = ps3ntfs_opendir(npath);
641 if(!pdir) is_ntfs = false;
642 cellRtcSetTime_t(&rDate, 0);
643 if(!npath[7]) npath[6] = 0;
644 }
645 #endif
646
647 #if defined(FIX_GAME) || defined(COPY_PS3)
648 if(copy_aborted) _concat(&sout, STR_CPYABORT); // /copy.ps3$abort
649 else
650 if(fix_aborted) _concat(&sout, "Fix aborted!"); // /fixgame.ps3$abort
651
652 if(copy_aborted | fix_aborted) {_concat(&sout, "<p>"); sys_ppu_thread_usleep(100000); copy_aborted = fix_aborted = false;}
653 #endif
654
655 syscalls_removed = CFW_SYSCALLS_REMOVED(TOC);
656 if(syscalls_removed)
657 {
658 sprintf(html2, "<h1>%s</h1>%s", STR_CFWSYSALRD, HTML_RED_SEPARATOR); _concat(&sout, html2);

Callers 1

www_client.hFile · 0.85

Calls 15

_setFunction · 0.85
_concatFunction · 0.85
_concat2Function · 0.85
absPathFunction · 0.85
is_ntfs_pathFunction · 0.85
check_ntfs_volumesFunction · 0.85
ntfs_pathFunction · 0.85
ps3ntfs_opendirFunction · 0.85
ISFunction · 0.85
add_breadcrumb_trailFunction · 0.85
get_default_usb_driveFunction · 0.85
connect_to_remote_serverFunction · 0.85

Tested by

no test coverage detected