Author Topic: File not found problem on the iPhone  (Read 2549 times)

MrTAToad

  • Guest
File not found problem on the iPhone
« 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


Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: File not found problem on the iPhone
« Reply #1 on: 2010-Mar-14 »
hmm interesting. Did you called setcurrentdir("Media") or whatever? internal bug ??? hmm wait for kittie
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

MrTAToad

  • Guest
Re: File not found problem on the iPhone
« Reply #2 on: 2010-Mar-14 »
No, I don't use setcurrentdir - just access it with Media/...


MrTAToad

  • Guest
Re: File not found problem on the iPhone
« Reply #3 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 ?
« Last Edit: 2010-Mar-14 by MrTAToad »

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1545
    • View Profile
Re: File not found problem on the iPhone
« Reply #4 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.

MrTAToad

  • Guest
Re: File not found problem on the iPhone
« Reply #5 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...

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2793
    • View Profile
Re: File not found problem on the iPhone
« Reply #6 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.
 
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Wampus

  • Prof. Inline
  • *****
  • Posts: 1004
    • View Profile
Re: File not found problem on the iPhone
« Reply #7 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.

MrTAToad

  • Guest
Re: File not found problem on the iPhone
« Reply #8 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
« Last Edit: 2010-Mar-17 by MrTAToad »