usb_mass read dir issue

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
User avatar
kouky
Posts: 48
Joined: Tue Sep 25, 2007 5:38 am
Location: London
Contact:

usb_mass read dir issue

Post by kouky »

Hello, I'm trying to find a way to read directories on a usb stick.

I'm using the usb_mass example, the moduels are said to be correctly loaded, but...
the function:

listDirectory("/");

Code: Select all

void listDirectory(char* path) {
	int ret;
	fat_dir_record record;
	int counter = 0;
	
	TWIN_PRINTF("DIRECTORY LIST path=%s \n", path);
	TWIN_PRINTF("------------------------------------ \n");
        /* list the root directory */

	ret = usb_mass_getFirstDirentry(path, &record);
	while (ret > 0 ) {
		counter++;
		listDirRecord(&record);
		ret = usb_mass_getNextDirentry(&record);
	}
	if (counter == 0) {
                TWIN_PRINTF("no files in root directory ? \n");
	}
}
always return the "no files in root directory ?" error...
I've tried with "/", "mass:/", "mass0:/", "mass://" but always the same error...

any help ?

Hint: I'm using the pink slim PS2, I'm booting with Swap magic, and I'm running the mass_example.elf from the same usb stick I'm triying to read thre directories from.
softwares for artists on video game systems - http://www.pikilipita.com
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

I'm getting the same results for my usb pendrive, there are files on the pendrive, however the usb mass example does not list them.
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

Hmm interesting. It worked on particular conditions... Could it be an init issue?

My load procedure : Boot from Datel Memory Plus 64 using lukasz loader http://lukasz.dk/2008/04/22/datel-memory-plus-64-mb which loads uLE as mc0:/BESLES-00000 MP/EXECUTE1.ELF, launch PS2Link1.51, launch mass_example.elf : And I get the same results as you.

But, if I do the same boot procedure as above but boot the PS2 with the USB pen inserted (although uLE is still loaded from the memory card, not from USB), the example works fine.

@kouky,
Also look at oggplayerbeta01 from CarelessWhisper. It reads dir and loads (ogg) files from USB just fine :
http://www.ps2-scene.org/forums/ps2-hom ... hlight=Ogg
User avatar
kouky
Posts: 48
Joined: Tue Sep 25, 2007 5:38 am
Location: London
Contact:

Post by kouky »

Just tried the oggplayerbeta01 and it works :)

I'll try to investigate its source now.

Thanks for your help!
softwares for artists on video game systems - http://www.pikilipita.com
Post Reply