You Are Here:

Community: Developer Discussion Boards

#1 Old Create directory Nokia 6681 - 2006-11-26, 22:05

Join Date: Dec 2005
Posts: 19
roger.kock
Offline
Registered User
Hello!

I have an Nokia 6681 and I'm trying to create an directory in his memory with this code:

Code:
String path = "file:///Roger_Compartilhados/";
FileConnection createDirectory= (FileConnection) Connector.open(path);
// Always check if the directory exist.
// Create the directory if it doesn't exist.
if (!createDirectory.exists()){
  createDirectory.mkdir();
}
catch (Exception ex) {
  screen.showAlert("Error!", ex.getMessage(), 0, null, "img");
}
But when the application tries to create the directory, the cellphone returns this message:

"Opening a connection failed: -5"

Somebody knows what this can be?

Thanks in advance!
Roger.
Reply With Quote

#2 Old Re: Create directory Nokia 6681 - 2006-11-28, 02:49

Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
peterblazejewicz
Offline
Super Contributor
hi Roger,

shouldn't your path be constructed taht way?
Code:
String path = System.getProperty("fileconn.dir.memorycard")+"Roger_Compartilhados/";
not sure what is that message, is it thrown within exception?

regards,
peter
Reply With Quote

#3 Old Re: Create directory Nokia 6681 - 2006-11-28, 11:00

Join Date: Dec 2005
Posts: 19
roger.kock
Offline
Registered User
Hello Peter, thanks for the answer.
Yes, it is thrown within exception. I'll try your code and post here the results.

Thank you very much again! :-)
Roger.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Series 60 Concept Emulator (SDK Beta 0.2 Linux) not working mattbee Mobile Java Tools & SDKs 1 2003-06-10 12:43

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia