Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Trying to save highscore in json file but file error No such file or directory
Started by KOXISA Apr 01 2019 09:03 AM

5 replies to this topic
file error highscore read file open file

Best Answer GrahamRanson , 02 April 2019 - 01:32 AM

If you're interested, my Puggle library makes saving data such as high scores very easy:

https://www.grahamranson.com/saving-high-scores-with-puggle/

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

KOXISA

[GLOBAL: userInfoPane.html]
KOXISA
  • Observer

  • 3 posts
  • Corona SDK

Hello everybody! I'm trying to save my highscore but i see error File error: C:\Users\romlu\AppData\Local\Corona Labs\Corona Simulator\Sandbox\stand out-5004F908333A8F9EE4A9B4F8532E8EA1\Documents\highscore.json: No such file or directory

 

I just open the file and trying to write information in it and read the content but i see this error. Help me please.
 
This is a part of my code.


[TOPIC: post.html]
#2

mjako

[GLOBAL: userInfoPane.html]
mjako
  • Observer

  • 7 posts
  • Corona SDK

Hello, you must open the file with "w" parameter until you want to write to the file:

local file, errorString = io.open( path, "w" )

Hi



[TOPIC: post.html]
#3

KOXISA

[GLOBAL: userInfoPane.html]
KOXISA
  • Observer

  • 3 posts
  • Corona SDK

But if i want to get highscore from file and i have the same error as i am trying to write the file - file not found

[TOPIC: post.html]
#4

GrahamRanson

[GLOBAL: userInfoPane.html]
GrahamRanson
  • Enthusiast

  • 92 posts
  • Corona SDK

  Best Answer

If you're interested, my Puggle library makes saving data such as high scores very easy:

https://www.grahamranson.com/saving-high-scores-with-puggle/


  • KOXISA likes this

[TOPIC: post.html]
#5

KOXISA

[GLOBAL: userInfoPane.html]
KOXISA
  • Observer

  • 3 posts
  • Corona SDK

If you're interested, my Puggle library makes saving data such as high scores very easy:

https://www.grahamranson.com/saving-high-scores-with-puggle/

Thanks, your library is very useful, it really helped me!



[TOPIC: post.html]
#6

GrahamRanson

[GLOBAL: userInfoPane.html]
GrahamRanson
  • Enthusiast

  • 92 posts
  • Corona SDK

Glad to hear it!




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: file error, highscore, read file, open file