How to create a csv file in TC55 Internal folder

M Mohankumar SK 3 years 7 months ago
4 1 0

Hi all,

I want to create a file in TC55 but getting permission denied error at "/internal/download/" I tried to create in SDCard also same error. but its working in emulator please help me to solve this problem.

I used this method
var myFile = new Rho.RhoFile(Rho.File.join(Rho.Application.userFolder,"myfilename.txt"),);
to create a file. but getting uninitialized constant Rho:RhoFile error in tc55 device. Please advise how to resolve this issue.

Below is My sample code:-

@filename = "/internal/RWSFilePath/StockTakeResult/StockTakeResult.csv"
File.open(@filename, "w+") do |aFile|
if aFile

 
aFile.syswrite("HEADER,CSTK201234234,poonam.sharma,C,")

 
aFile.syswrite("\n")

 
aFile.syswrite("StockTakeDetail,TicketNo,AssetID,AssetCode,ZoneID,ZoneCode,LocationID,LocationCode,SubLocation1ID,SubLocation1Code,SubLocation2ID,SubLocation2Code,SubLocation3ID,SubLocation3Code,CategoryID,CategoryCode,SerialNo,Remarks,LabelStatus,VerificationStatus,TicketClose")

 
aFile.syswrite("\n")  

end

end

Please Register or Login to post a reply

1 Replies

J Jon Tara

Confused by your code examples. You have two. Which is the code you are actually having trouble with?

Is this Javascript of Ruby? Your examples are inconsistent:

  Rho.RhoFile
  Rho.File
  File

Which is it? It should be:

Ruby:  Rho::RhoFile
Javascript: Rho.RhoFile

File is the standard Ruby File class. You can use it as well, but it's not exactly the same. Not really sure what the advantage of RhoFile is, other than it has some Rhodes-specific things like join, file paths, etc.

Rho::File is an old 2.2 API. If you are using Rho::RhoFile, do not use Rho::File.

CONTACT
Can’t find what you’re looking for?