Saving files
Hello
Using the example in http://developer.blackberry.com/native/documentation/playbook/com.qnx.doc.native_sdk.devguide/com.qn...
Im trying to save data to a file for my game. My code is as follows:
std::string path1 = CCFileUtils::sharedFileUtils()->getWriteablePath(); path1.append("save.dat"); FILE *fp = fopen(path1.c_str(), "wb"); CCLog("path is %s",path1.c_str()); if (!fp) { CCLog("error!!!!!"); } else { int page; int firstRead = fscanf(fp, "%i", &page); CCLog("file read value is %d %d",firstRead,page); if(firstRead == -1) { fprintf(fp,"%i",globalVolume); fprintf(fp,"%i",globalLevel); fprintf(fp,"%i",_timeAttack); fprintf(fp,"%i",_maxStreak); for(int i = 0;i < 30; i++) { fprintf(fp,"%i",((CCString *)_score->objectAtIndex(i))->intValue()); } } } // fprintf(fp, "%i", page); fclose(fp); fp = fopen(path1.c_str(), "wb"); if (!fp) { CCLog("error!!!!!"); } else { int page; int firstRead = fscanf(fp, "%i", &page); CCLog("file read value is %d %d",firstRead,page); } fclose(fp);
The output I get is:
path is /accounts/1000/appdata/org.cocos2dx.Test.testDev__Test2c5a53de/data/save.dat
cocos2d-x debug read value is-1-1323428880 information file
read value is-1323428880-1
read value is-1323428880-1.
I test it on the Simulator. Is there something wrong with what Im doing? Is - this file save the work on the Simulator?
Thank you.
I use instead of fprintf fputs and everything is ok for me
Tags: BlackBerry Developers
Similar Questions
-
When saving files, menu drop-down is not displayed, just a little.
When you attempt to save a bookmark using the "Bookmark this page", then by selecting Menu bookmark to display a list of recorded files, the list of the saved files that appears is a short partial list. This list does not scroll to view unlisted remaining folders. All of these files are searchable/accessible when "show all bookmarks".
fredmcd,
The method that seems to work OK is to use the method you describe. It requires another step to click or two, but I can see and reach all my saved files when you save a bookmark. Thanks for the suggestion of workaround.I would suggest that there is a bug in there somwhere that needs to be squashed. It prevents a complete list of saved folders and bookmark s from being displayed under Bookmarks Menu when Bookmark this Page is selected.
Thanks again, have a nice day.
rlhall3071 -
Satellite A660 - cannot see the saved files
The problem is with a game I have.
I see a file that I downloaded on the net to play, but the game files that I saved do not appear when I look for them that they don't show up. But when I view the compatibility files, they show, but me is not good since I can't send them to others who need to use them. The game in question is civilization 3 conquests, but I have a PC with it on and did not have this problem.
So where can I find the setting to make them visible?
>... can't see the saved files
Is - this general problem with your computer laptop or you have noticed with the game only files?
I mean that's not easy to say anything on this specific issue.I m not a gambler so I can't comment on some problem of game files.
Try to find a game forum where people discuss civilization 3 conquests and ask if anyone else has noticed the same problem. -
My entire office and saved files were deleted from my computer. I don't know what happened
When I started my computer this morning everything on my desktop disappeared and I got a black screen. All the icons on my task pane were still missing. I can't find the saved files. Help, please
Hello
1. what operating system do you use?
2. ensure that you are connected under the same account that you used to log on before?
If you use the Windows XP operating system:
(a) click Start.
(b) select my computer.
(c) double click on the C drive icon.
(d) double-click the Documents and Settings folder.
(e), find the folder with the name as your diary in the name of the system.
(f) open this folder and check if you find the missing file.If you are using the Windows Vista/7 operating system:
(a) click on the Windows icon.
(b) select computer.
(c) double click on the C drive icon.
(d) double-click the users folder.
(e), find the folder with the name as your diary in the name of the system.
(f) open this folder and check if you find the missing file.You can also check out the link:
http://Windows.Microsoft.com/en-us/Windows7/show-hide-or-resize-desktop-icons
-
How to stop the pop-up for saving files when I start the computer?
I was going to save files on a drive of DVD-CD-R, but I decided to do not, how can I stop the pop-up for saving files when I start the computer? It keeps appearing even though I cancelled check?
* original title - cancel recording of dvd/cd-rw *.
Hello
Windows displays a temporary storage area where files are held before they are copied to the CD. Files or folders located in the temporary storage area are listed under files ready to be written on the CD.
Try the steps and check them off below if it helps:
a. double-click my computer and then double-click the CD burner.
b. under CD writing tasks, click on delete temporary files.
When you delete the contents of the temporary storage area, you can set this field to another set of files and folders that you want to copy to the CD. The files are not deleted from their location on your computer or on the CD.
-
How can I find my saved files?
How can I find my saved FILES T J
HOW T J
Hello
Are you talking about search file of the Internet Explore or Windows file search?
If you do reference for monitoring of internet research explore the article below:
http://Windows.Microsoft.com/en-us/Windows-Vista/find-a-file-you-have-downloaded Note: Thus, it applies to Internet Explorer 9.
If you refer for a follow-up to search for the file Windows section below:
Find a file or folder:
http://Windows.Microsoft.com/en-us/Windows-Vista/find-a-file-or-folderHope the information is useful.
-
I just replaced my hard drive. Can I replace everthing that I had saved by choosing "Restore" and it points to a saved file? Also all the Windows setting will find?
Find all programs I had installed in C:?
See if this tutorial will help.
http://www.SevenForums.com/tutorials/675-system-image-recovery.html
-
Original title: temporary profile
I was wondering if anyone can help... I have a compaq laptop, windows 8 and the last few times ive turned on n signed in its took much longer than usual and connect to a temporary profile where it seems that everything I had there before such as files and photos have already disappeared. But it then opens with a message saying something along the lines of. . "You have been logged on with a temporary profile, in this profile, you can access saved files and any new tjing created or added to this profile will not be saved" does anyone know how solve this...
Hi Lucie,.
Activation of the built-in Administrator account can help get the problem solved.
Perform the steps suggested by Pinaki displayed from the link below and see if it helps.
Answer please if you have any questions.
-
Illustrator crashes when saving files in the default directory not in Mac OS 10.10 or OS 10.11. What is the solution?
There is no solution.
If that is your only question, you should be happy.
El Capitan Yosemite and CS5 are not compatible. For some people it can run more or less, for others not so much.
-
No longer works since yesterday my Acrobat Reader DC evening. He says the same normal an invitation to subscribe. Or I am already up to autumn and I pay each month. Has happened when I tried to work on a saved file when I was still only the free app. Previously, it had however well Monday. I lose the nerves since this morning. Help me, I beseech you. Thank you.
Pluggable UN iMac 10.11.13
DC Pro Acrobat & Acrobat Reader DC are two different applications.
Acrobat Reader DC is a free application that is used to view PDF files.
For the modification/creation of associated features, you must use Acrobat Pro DC. I see that you have Acrobat Pro DC subscription.
Please open the PDF in Acrobat Pro DC use function related modification/creation of PDF. If Acrobat Pro DC is not installed on your system, you can install using this link https://helpx.adobe.com/acrobat/kb/download-install-acrobat-subscription.html
Kind regards
Nicos
-
Problem with the saved files. Black/multi-coloured boxes appear once saved?
I'm having a problem saving my images in Photoshop - the image looks perfect when I save the file to my desktop, but when I open the saved file (on preview or photoshop), he seems to have either a black or multi-colored box boxes covering part of the image. I downloaded the image on Facebook and she was always covered by these colorful boxes. I uninstalled Photoshop (2014) and I am not install the latest version via CC (although it does not fully install - it stops at about 68% every time). It is quite frustrating because I have a few photography projects, I've been working at this time. Please can you advise me on what I need to do to fix this?
[left Adobe Creative Cloud for Discussion General Photoshop]
-
try to change the text in a saved file, but it will not allow isolate me the text, place the cursor in the text box or simply go back to remove.
Hello
in what format save you your file? If it's a jpg file, then the text is compressed and unfortunately PS is telling things as they are. Even if you could change the text before you save, after having been saved in jpg format, the text is merged and is no longer editable.
A good solution is to save the files as PSD files, photoshop files. In this case, all layers are saved uncompressed and so your text will appear in its own layer in photoshop. All you need to do in this case to change it is the result of a three-step procedure
(1) select the right layer
(2) take the text tool in the tools bar
(3) mark and change your text
So the crucial question is: in what format you save your file?
-
I can't find files because hyphens prevent the word search. It's really a lot of time to go back and change the names of all the renders that I do for web pages. I don't use dashes, when I type in the name of the file that I save. How can I get him to stop to change the names of my files?
In the save for Web > Output Settings > saving files uncheck Unix under file name compatibility and see how it works.
According to me, the other settings in the backup section files concern when we record slices.
-
just upgraded to Imac 27 "5K, installed the Software Photoshop cs4, then saving files get 'could not save file currently in use or is still open' how can I remedy?
Check this message: Re: "cannot save (file name) because the file is already in use or left pending."
-
can't understand why the gif file loop. Implemented 480x320pixels of photo frames 5 x 72pix / in in PE11, creating a layer for each. Each visible layer. Registered for the web. Checked to animate. The preview plays very well. But when I save the file and then click on the saved file to play, he re - opens the layers instead of playing the loop. The only registration option that appears is "IMAGES ONLY".
Using photoshop elements on MAC 10.6.8 11. Either I'll put this in wrong place or is there a hidden setting I need to change?
It you open in a web browser? That's where he plays, not in PSE, overview, or on your desktop.
-
Problems with saving files, creating new layouts div fluid
Problems with saving files, creating new layouts div fluid. Can I reinstall all the software Dreamweaver?
Thank you
I reinstalled and all is well.
Sent from my iPad
Maybe you are looking for
-
Download "server not found" for a website, work on other computers
This is a secure site for which I have an account to do business. Get the same results in the Explorer, and then on my windows smartphone. Checked and it is not a site dedicated to security options.
-
activation of the relay using rs 23
Is there any sign of low cost in which a relay can be activated through labview with rs 232 communication. Please let me know as soon as possible. I need to acivate for a 5V with a labview timer relay and it should be communicated via rs 232 for the
-
Pre-release version of Windows 7?
I just got a copy of Windows 7 that I bought on a site web student/faculty only. I bought it with Office 2007.He said "available immediately".I thought that meant simply Office 2007!I have Win 7 Ultimate too & it's only at the end of September.A I ge
-
Windows vista copy-alternative flight
Microsoft offers no way to replace their original copy of Vista which was stolen in a robbery by a customer? How can we do for rplacing their copy?
-
DELETED THE DATA ON MY PC IF I UPDATE WINDOWS 10? THE CURRENT VERSION OF MY LAPTOP IS WINDOWS 7.