GLBasic forum

Main forum => GLBasic - en => Topic started by: MrTAToad on 2010-Mar-14

Title: File not found problem on the iPhone
Post by: MrTAToad on 2010-Mar-14
I'm trying to load a file from Media/Music, but for some reason, DOESFILEEXIST (Result = 0) doesn't find it :

Code (glbasic) Select
request: fopen("Media/Music/Wings_Of_A_Hero__BA013701.mp3", "rb") failed
File : Media/Music/Wings_Of_A_Hero__BA013701.mp3
Result : 0
Current directory : /private/var/mobile/Applications/A985AFB0-73E8-496B-B9BE-546AA356F40B/The_Grid_iPhone.app/
request: fopen("Media/Music/Wings_Of_A_Hero__BA013701.mp3", "rb") failed


But as you can see from the included picture, the file is present and has the correct case
(http://i475.photobucket.com/albums/rr115/MrTAToad/xcode.png)
Title: Re: File not found problem on the iPhone
Post by: trucidare on 2010-Mar-14
hmm interesting. Did you called setcurrentdir("Media") or whatever? internal bug ??? hmm wait for kittie
Title: Re: File not found problem on the iPhone
Post by: MrTAToad on 2010-Mar-14
No, I don't use setcurrentdir - just access it with Media/...

Title: Re: File not found problem on the iPhone
Post by: MrTAToad on 2010-Mar-14
The odd thing is that it (appears) to work with other files in other directories off Media (and all use "Media/xxx").

Before loading any files, DOESFILEEXIST is used before loading (so a error message can be displayed if a file cant be found).

Just wondering if "Music" is a reserved directory name or something  :blink:

I wonder if the file transfered across to the iPhone ?  If not, why not ?
Title: Re: File not found problem on the iPhone
Post by: matchy on 2010-Mar-14
Firstly, what's the practical intent for not using SETCURRENTDIR$ because I have no idea why you are avoiding it really.

PLAYMUSIC file$,loop% alone seems to only accept file names, as stated in the help file, rather than full paths.

For example, this doesn't even work: PLAYMUSIC GETCURRENTDIR$()+"Media/Music/song.mp3",0

So the SETCURRENTDIR$(path$) must be reset for each music file for DOESFILEEXIST() to perform correctly.
Title: Re: File not found problem on the iPhone
Post by: MrTAToad on 2010-Mar-14
No, its not even getting to loading the file part yet - it checks for the presence of the file first and then loads.  Unfortunately its failing the first part...
Title: Re: File not found problem on the iPhone
Post by: bigsofty on 2010-Mar-14
Not really related but I used 'setcurrentdir' on Win32.

Worked for a bunch of BMPs

The I tried to load a PNG on the next line, it could not find it. I added '/Media' to the path it worked. I moved it above the BMPs, load lines, then it also worked. No change of dir at all, one place it worked, other it did not. I think it may'be loosing the path.

Again though Mr T. I don't think this is directly related to your problem.
Title: Re: File not found problem on the iPhone
Post by: Wampus on 2010-Mar-15
Curious

If someone else can replicate this issue on another iPhone then that would be helpful.

If its only happening with the directory Media/Music on the iPhone (as far as anyone can tell) then at least it can be marked as a known issue with the workaround of changing the directory name.

If the MP3s are in different folders, can they be found? If a WAV file or other non-sound related files are in the Music folder, can they be found? Sorry, just suggestions. I would check this myself if I had an iPhone.
Title: Re: File not found problem on the iPhone
Post by: MrTAToad on 2010-Mar-16
It looks like I was using SETCURRENTDIR to go back to the initial directory.  So, I'll have to see if either GETCURRENTDIR$ or SETCURRENTDIR is failing/invalid

Once I removed Moru's font system, it all seemed to work okay  :S