Author Topic: user file guide  (Read 14840 times)

Offline alager

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
user file guide
« on: May 27, 2009, 12:47:39 AM »
Mark,

I have two things I'd like to do.  One is to create a file in RAM, that is accessible by file name in a web browser.  The reason for RAM is that its contents will be changing a lot, and I don't want to wear out the flash.  I'm going to be updating a web page in near real time using Ajax techniques.

The other thing is how do I go about accessing a file (read & parse it) that has been ftp'ed or posted to the uTasker file system?  I want to put a file in the file system that will contain parameters that direct the system what to do.  The name will be a known constant. 

Thanks,
Aaron

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: user file guide
« Reply #1 on: May 27, 2009, 11:09:02 AM »
Hi Aaron

I think that the new user file support would be appropriate in your case. This allows files to be positioned in SRAM and has proven useful for work with AJAX:
http://www.utasker.com/docs/uTasker/uTaskerUserFiles.PDF

Presently I am in the process of updating its document due to some extensions (including FTP compatibility) which should allow you to do everything that you need with it. I will send you a small update package to add this to your project and then you can verify that it operates as required and tell me if any restrictions should still exist. I will get the package to you later on today - you will see when the document has been updated because it will have the index /0.01 and today's date.

Regards

Mark

Offline Richard

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: user file guide
« Reply #2 on: June 04, 2009, 10:01:49 PM »
Hi, Aaron & Mark.

Another approach, which works for me, is to use the existing "£v" mechanism with WEB_ESCAPE_LEN set to 5, to allow five-character strings [and don't forget to modify all of the web pages that came with uTasker].

In a static web page, say Z.htm, I put a string of £vX£Y for the various Y values I want to access with my XMLHttpRequest document, doc using doc.open("GET",Z.htm?...params...,false).  The X following £v is a character not already in use that I've programmed to cause fnInsertString() to access fnInsertMyString() that I've written.  It substitutes the second £ with a value passed in by the parameters of the doc.open() request.  Based on that result, it chooses which values to return.  Since the web pages themselves are static, there is no need to worry about wearing out FLASH.

One thing -- very important -- to prevent various browsers from reusing previous, cached values, I've found it necessary to append the current time to the doc.open("GET",...) parameters.  Some browsers can be convinced not to cache results, but this is the only way I've found to force all browsers that I've tried to use new data passed back.  The downside is that the cache is being filled with old values that won't ever be reused.  I think this applies to all AJAX programs.  If I'm wrong, or if someone knows a better way to accomplish this, please let me know!

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: user file guide
« Reply #3 on: June 26, 2009, 01:08:48 AM »
Hi All

There has been an update to the user file document including new details of support for embedded user file collections. This is made possible by a new utility called uTaskerFileCreate.

This essentially allows a complete collection of files (with long names etc.) to be generated and placed into a single uFileSystem compatible file (in internal or external SPI FLASH). This file can be sent via FTP /HTTP post etc., deleted and updates, thus having the advantages in user file operation together with flexibility of uFileSystem operation. Full details in the doc. http://www.utasker.com/docs/uTasker/uTaskerUserFiles.PDF

This will all be available in the next SP, whereby SP updates are being frantically worked on for all targets for the "very" near future (hopefully before my summer vacation starts...!!)

Regards

Mark