View Issue Details

IDProjectCategoryView StatusLast Update
0004660Multi Theft Auto : San AndreasServerpublic2009-08-16 15:04
ReporterKillFrenzyAssigned ToArc 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version1.0 
Summary0004660: fileCreate stopped working
Description

fileCreate does not work in the latest nightly's. It will not create the file and always return false.

Additional Information

In the latest nightly's tested (r1304 and r1305), fileCreate seemed to stopped working. Reverting to an old nightly (r1241) fixed the problem.

TagsNo tags attached.

Activities

KillFrenzy

2009-07-17 18:44

viewer   ~~0009983

I've just tested fileCreate in version r1297, and it's working properly.

Paul_Cortez

2009-07-17 18:45

reporter   ~~0009984

Could you please show us an example code where it doesn't work?

KillFrenzy

2009-07-17 19:01

viewer   ~~0009985

Last edited: 2009-07-17 19:07

Sure, it's quite easy to replicate. Now I got an access denied when trying to upload a file, so I'll just post the snippet here.

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()),
function (startedResource)
local fileHandle = fileCreate("test.txt")
if fileHandle then
print("File create success")
fileClose(fileHandle)
else
print("File create failed")
end
end
)

After further testing, fileOpen shows no warning when the file is not found for the latest nightlys. Also, I suspect it could be related to this change:
http://code.google.com/p/multitheftauto/source/detail?r=1304

NeonBlack

2009-07-17 19:02

viewer   ~~0009986

-- example code from the wiki
-- http://development.mtasa.com/index.php?title=FileWrite
local fileHandle = fileCreate("test.txt") -- attempt to create a new file
if fileHandle then -- check if the creation succeeded
fileWrite(fileHandle, "This is a test file!") -- write a text line
fileClose(fileHandle) -- close the file once you're done with it
print"Created file and wrote the text line."
else
print"Could not create file for some random reason."
end

Output: Could not create file for some random reason.

Issue History

Date Modified Username Field Change