Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / April 2008



Tip: Looking for answers? Try searching our database.

Can you do file I/O?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SpreadTooThin - 28 Apr 2008 22:36 GMT
on an iPhone application?
is there a filesystem?
I have an application that reads text files and its failing to open a
file that is bundled with the application.

  fb.open (fname.c_str(), std::ios::in);

this call fails... (I know its C++, but that I don't think is the
issue)
Tom Harrington - 29 Apr 2008 03:46 GMT
In article
<0a83773e-121f-403a-916d-bfc18e676c13@q24g2000prf.googlegroups.com>,

> on an iPhone application?
> is there a filesystem?
[quoted text clipped - 5 lines]
> this call fails... (I know its C++, but that I don't think is the
> issue)

Well, are you sure that fname has a valid path?  That's the obvious
thing to check, and if you're not even sure if a filesystem is
available, how do you know you've got a valid path on that filesystem?

Signature

Tom "Tom" Harrington
Independent Mac OS X developer since 2002
http://www.atomicbird.com/

SpreadTooThin - 29 Apr 2008 14:55 GMT
On Apr 28, 8:46 pm, Tom Harrington <t...@pcisys.no.spam.dammit.net>
wrote:
> In article
> <0a83773e-121f-403a-916d-bfc18e676...@q24g2000prf.googlegroups.com>,
[quoted text clipped - 12 lines]
> thing to check, and if you're not even sure if a filesystem is
> available, how do you know you've got a valid path on that filesystem?

I checked the path/filename and it exists under the simulator,
But remember I'm running in the simulator and I just don't know how
closely the simulator is to the actual device.

> --
> Tom "Tom" Harrington
> Independent Mac OS X developer since 2002http://www.atomicbird.com/
Tom Harrington - 29 Apr 2008 20:51 GMT
In article
<46f65111-6b42-4031-b203-b80ccbbaee4d@r9g2000prd.googlegroups.com>,

> On Apr 28, 8:46 pm, Tom Harrington <t...@pcisys.no.spam.dammit.net>
> wrote:
[quoted text clipped - 18 lines]
> But remember I'm running in the simulator and I just don't know how
> closely the simulator is to the actual device.

Well, my NDA prevents me from getting too specific.  But I don't think
I'm giving anything away by saying that it's probably a bad assumption
to assume that the same path will be correct in both cases.  You could
stand to look at whatever code generates fname and make sure it's not
making assumptions that don't apply in both cases.

Signature

Tom "Tom" Harrington
Independent Mac OS X developer since 2002
http://www.atomicbird.com/

SpreadTooThin - 29 Apr 2008 21:46 GMT
On Apr 29, 1:51 pm, Tom Harrington <t...@pcisys.no.spam.dammit.net>
wrote:
> In article
> <46f65111-6b42-4031-b203-b80ccbbae...@r9g2000prd.googlegroups.com>,
[quoted text clipped - 31 lines]
> Tom "Tom" Harrington
> Independent Mac OS X developer since 2002http://www.atomicbird.com/

This is how the path to the file was derived....

std::string getDictionaryPath()
{
    return(std::string([[[NSBundle mainBundle] resourcePath]
UTF8String]));
}
Does that help you any?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.