File.applicationStorageDirectory problem

Hello dear adobe air community!
I'm new to air mobile development and i'm currently facing a weird problem with File API and its applicationStorageDirectory property.
Please correct me if i'm wrong but it seems that every files stored in applicationStorageDirectory are not deleted during application update, true?
In m'y case, I'm using applicationStorageDirectory to store application database with some user settings. Obviously, these settings should be kept during application update process. Unfortunately, they are removed each time I'm updating the application...
Any ideas? Can this behaviour should result for a bad configuration of my air descriptor file?
Thanks in advance for your help...

Thank you Chris for your quick answer.
My database file is copied when the application starts up.
A check is performed before copying the database file.
However, after application update, the database seems to be removed  and recreated...
The following code performs the database initialization:
* Init the database with a default database file.
* @param dbFilePathSource
* @param dbFilePathTarget
public static function initDatabase(dbFilePathSource:String, dbFilePathTarget:String):void {
trace("IN initDatabase.");
// DB files lookup
var embeddedSessionDB:File = File.applicationDirectory.resolvePath(dbFilePathSource);
var writeSessionDB:File = File.applicationStorageDirectory.resolvePath(dbFilePathTarget);
// If a writable DB doesn't exist, then we copy it into the app folder so it's writable
if (!writeSessionDB.exists) {
trace("DB file does not exist at path [" + dbFilePathTarget + "]. DB file file be created from reference file stored at path [" + dbFilePathSource + "].");
embeddedSessionDB.copyTo(writeSessionDB);
Thank you...

Similar Messages

  • Hwo to delete files resides in the File.applicationStorageDirectory?

    i created a method saveLocally() to store the images temporarily which are obtained from the server.
          saveLocally(fileName:String, data:ByteArray):void
                var file:File = File.applicationStorageDirectory.resolvePath(fileName);
                var fileStream:FileStream = new FileStream();
                fileStream.open(file, FileMode.WRITE);
                fileStream.writeBytes(data, 0, data.length);
                fileStream.close();    
                                 these files are stored in "… C:\Documents and Settings\Administrator\Application Data\ImageGallery\Local Store"
    after i closed my application the files which are stored in the Local Store Directory are still

    Hi Ariv,
    Try to save the images in a Folder instead of directly saving in the Local Store directory in the  "C:\Documents and Settings\Administrator\Application Data\ImageGallery\Local Store" path.
    If you save them inside a particular folder then you can directly point to that folder where images reside and you can easily delete the contents with out any problem for other contents in the Local Store directory.
    If you directly save the images in your Local Store directory without any sub directory then it will be difficult for you to delete all the images at once as you may have other contents in the Local Store along with your images and so you cannot delete them at once and you need to point to each image file and delete single image file.
    So in order to avoid this you can store all the images in seperate folder in your ApplicationStorage directory and delete the contents(images) of the folder directly.
    So create a folder Images in the  Local Store directory and point to that Images drectoy in your code "C:\Documents and Settings\Administrator\Application Data\ImageGallery\Local Store\Images\image1.png"
    Change your code as below:
    Note: Here File.applicationStorageDirectory itself points to the path -->  "C:\Documents and Settings\Administrator\Application Data\ImageGallery\Local Store"
    No need to of using File.applicationStorageDirectory.resolvePath("Local Store"); or  File.applicationStorageDirectory.resolvePath("ImageGallery");
    Try to use debugging as what path you are actually getting then you know whats exactly happening...
    public function onclose():void
         //Here Images folder is the new folder now in which your images should be saved.
          var myFile:File = File.applicationStorageDirectory.resolvePath("Images");
           if(myFile.exists)
                myFile.deleteDirectory(true);  
    Thanks,
    Bhasker

  • Help with add file name problem with Photoshop CS4

    Frustrating problem: Help with add file name problem with Photoshop CS4. What happens is this. When I am in PS CS4 or CS3 and run the following script it runs fine. When I am in Bridge and go to tools/photoshop/batch and run the same script it runs until it wants interaction with preference.rulerunits. How do I get it to quit doing this so I can run in batch mode? Any help is appreciated. HLower
    Script follows:
    // this script is another variation of the script addTimeStamp.js that is installed with PS7
    //Check if a document is open
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.INCHES;
    try
    var docRef = activeDocument;
    // Create a text layer at the front
    var myLayerRef = docRef.artLayers.add();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";
    var myTextRef = myLayerRef.textItem;
    //Set your parameters below this line
    //If you wish to show the file extension, change the n to y in the line below, if not use n.
    var ShowExtension = "n";
    // Insert any text to appear before the filename, such as your name and copyright info between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextBefore = "Lower© ";
    // Insert any text to appear after the filename between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextAfter = " ";
    // Set font size in Points
    myTextRef.size = 10;
    //Set font - use GetFontName.jsx to get exact name
    myTextRef.font = "Arial";
    //Set text colour in RGB values
    var newColor = new SolidColor();
    newColor.rgb.red = 0;
    newColor.rgb.green = 0;
    newColor.rgb.blue = 0;
    myTextRef.color = newColor;
    // Set the position of the text - percentages from left first, then from top.
    myTextRef.position = new Array( 10, 99);
    // Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
    myLayerRef.blendMode = BlendMode.NORMAL;
    // select opacity in percentage
    myLayerRef.opacity = 100;
    // The following code strips the extension and writes tha text layer. fname = file name only
    di=(docRef.name).indexOf(".");
    fname = (docRef.name).substr(0, di);
    //use extension if set
    if ( ShowExtension == "y" )
    fname = docRef.name
    myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
    catch( e )
    // An error occurred. Restore ruler units, then propagate the error back
    // to the user
    preferences.rulerUnits = originalRulerUnits;
    throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );

    you might want to try the scripting forum howard:
    http://www.adobeforums.com/webx?13@@.ef7f2cb

  • SOMEONE PLEASE HELP WITH MISSING FILES XP PROBLEM

    i recently purchased an ipod touch, and all i want to do is get some music on it, and update the firmware, but i cant use itunes, cuz im getting 'there are some files missing' problem.
    I swear to god, if i dont get this fixed by the end of the week, im gonna post the latest video on youtube... on how to smash up apple products.
    Ive been trying NOT to buy apple products since the first dawn of time, but i do actually like the ipod touch. But, low and behold... the very reason why i never buy apple products has been confirmed!
    can someone PLEASE tell me if there is a solid fix for this? i have literally tried EVERYTHING before you ask. im at my wits end.
    Using XP home, all updates installed... latest itunes,

    It will probably help if you'll post the exact error message and when it's occurring. Otherwise we'll just be guessing, not that someone here might not have a good guess. I'm going to guess that this thread might help:
    http://discussions.apple.com/thread.jspa?messageID=11161893&#11161893
    Regards.

  • File sharing problems and horror story (nearly)

    I use Leopard on a MacBook Pro, a MacBook and a iMac G4 800 MHz (unsupported model).
    I have on the iMac and the MacBook Pro many users (the same ont he two machines) and I always use Fast User Switching.
    I have had very few problems with Leopard until now; I like it even if there are some glitches or some new features which are not my cup of tea (hierarchical menus missing from the dock, stacks useless when there are many items, FireWall impossibilities (?) to open specific ports, Back to my Mac working on a Lan but not from outside until now, problems with a few apps (Parallels networking erratic), ...
    Now about File Sharing.
    Let say my main account is user1 (Administrator), and I have another user2 also administrator, plus user3, user4 standard users.
    On the iMac I activate File Sharing.
    On the MacBookPro, as user1, if I connect to the iMac Server (using afp://IPaddress_of_theiMac/) I do NOT get the dialog
    "Enter your user name and password to access file server YYY
    Connect to server as Guest or as Registered User"
    but I directly get the dialog
    "Select the volumes you want to mount on YYY"
    From this, if I select user1 it mounts with full read/write permissions which is normal. It appears that I am connected with my Apple account user1&mac.com (same as mentionned in the Account panel of System Preferences).
    On the other hand, if I try to connect to the user2 account, I only get limited access although in the File Sharing Preferences, user1/iMac is mentionned with full Read/Write preferences for the Home Folder of user2.
    What is very surprising is that if I log on the MacBook Pro as user2, or user 3 or user4, then connect to the iMac, I first get the dialog to enter a user name and a password. This gives me access with the correct full permissions on user1/iMac or user2/iMac using the corresponding user name/password pair; this is the usual behaviour which is missing when trying to connect from user1/MacBook Pro.
    Now for the Horror Story!
    Trying to understand what was going on with the permissions of the user2/iMac account, I logged in to the iMac as user1, went to the Users folder and from there had a look on the informations about user2 home folder. In the lower part of the pannel, Sharing & Permissions says "You have no access" (which is normal) and this is followed by a table where users and permissions are listed. It seems user1 has Read and Write access in contradiction with the preceding phrase...
    Anyway, I tried to modify these authorizations for user2 by clicking on the lock of the Information pannel and entering name and password of the administrator. Didn't go farther than that. By mistake, I hit Command-Delete and user2 was GONE from the list AND NOT ONLY from the list in the Information window! Using Fast User Switching and going to user2, nothing left on the Desktop and NO Home anymore.
    In the System Preferences/Accounts panel, user2 was still mentionned.
    In the Users folder, no user2 folder anymore.
    Using once again Fast User Switching, I logged as user2 and got by magic an all new Home. Nothing left in Documents, Library or other user1 folders. Standard settings for icons, dock, etc.
    My first move has been to use a very recent backup to restore everything (Thank you Mike Bombich from Copy Cloner!).
    Once everything was back to normal, I had a look at the Trash from user1 and guess what, the Home folder of user2 was there, complete.
    So now I am left with two questions
    why is it I do not have the same dialogs when connecting from all the accounts although as far as I can see, configurations are the same?
    why is it possible, from an Information pannel to delete the account of another user?
    Thank you all for comments!

    For the file sharing problems, answer is found in
    http://docs.info.apple.com/article.html?artnum=306723

  • File path problem

    I have looked an read through almost all the file path problem post possible and I am still having issues maybe one of you guys can help me, here are my files
    I am doing this as an example so that I can apply it to all of my file problems....
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome
    Attachments:
    pathexample.zip ‏122 KB

    First of all, to troubleshoot the problem it would help to put some filepath indicators at each point so that you can see what is going on. Also, in your exe having an error dialog "Simple Error Handler.vi" to let you know what LabVIEW didn't like in the exe.
    Now, when you run a top level ("Main.vi") and use the "Current VI's Path " in the development mode it returns <Filepath>\"Current path"\Main.vi. So stripping once will get you to  <Filepath>\"Current path" .    Now if you make it into an exe the "Current VI's Path" returns <Filepath>\"Current path"\"Name.exe"\Main.vi so you are "nested" one deeper.
    I use the following construct to determine whether the vi is being used as in the development environment or as an exe, the parse the path accordingly, although in this instance it is used to supply different directory names to a little more complex file system.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Error when opening itunes : iTunes has stopped working ''A problem caused the program to stop working correctly''. When I repaired damaged files the problem still exists and also after uninstalling and redownloading and installing itunes. I have windows 8

    Error when opening iTunes : iTunes has stopped working '' A problem caused the program to stop working correctly''.
    When I repaired damaged files the problem still exists and also after uninstalling, redownloading and reinstalling iTunes.
    My pc is working with windos 8.
    Is there a solution?

    Hey there Rodney274,
    It sounds like you are getting an error from iTunes when you launch it. I would try the troubleshooting in this article named:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Start with troubleshooting for 3rd party plug ins section, then the rest of the article if needed:
    Start iTunes in Safe Mode
    Open iTunes in Safe Mode to isolate any interference from plug-ins or scripts not manufactured by Apple.
    Hold down Shift–Control while opening iTunes. You should see a dialog that says "iTunes is running in safe mode" before iTunes finishes starting up.
    Click Continue.
    See if the issue you're experiencing persists in Safe Mode.
    If you have the same issue while iTunes is in Safe Mode, proceed to the "Create a new user account" section. If you don't experience the same issue, follow these steps to remove third-party plug-ins.
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • File Info problems in Photoshop CC & CS5.1 on OS X 10.8

    I have recently upgraded my Macs, running OS X Mountain Lion, from Photoshop CS5.1 to Photoshop CC for two reasons:
    1. Because it most the most cost efficeint way to obtain the latest Camera Raw plugins that are no longer supported in CS5.1
    2. Because I began experiencing issues on two Macs where initially only in Bridge, was I no longer able to input any File Info dialogue.
    I make extensive use of File Info templates, which are then applied to batches of files in Bridge before individual files, or groups of files requiring the identical metadata are modified.
    After a time, once the overall batch of File Info templates had been applied to files I discovered that I was unable to edit them further. Even after Repairing Permissions in Disk Utility it usually took a reboot to fix the problem, although the problem was always solved.
    However there came a point a few weeks ago when I was unable write any further metadata to File Info, in Bridge or Photoshop, no matter what I did. Again this issue happened on two Macs so I'm guessing that it is not a machine issue.
    As I needed the latest Camera RAW plugins as well I decided to upgrade to Photoshop CC, which I have to say I have been very pleased with - until now. The dreaded File Info problem has now occurred again, although currently only in Photoshop, not Bridge. When I try to add or modify any information in File Info in Photoshop CC the dialogue box just closes!
    Clearly it is not just a Photoshop CC issue although I never had the problem prior to CS5.1 and I leapfrogged CS6 and I find it hard to believe that it is a machine issue. Could it be a conflict with the OS or with Extensis Suitcase Fusion 4?
    Has anyone else encountered this problem?

    Curt, Thanks for your rapid response.
    To answer your questions. I thought that, initially, the problem might be a permissions problem but it occurs on both boot drives and also when the same files are copied to Firewire external drives - on both Macs, but different external drives in each case. I followed your link but there was nothing there that I didn't already know or hadn't already tried, thanks.
    One computer is a 24" iMac and the other is a 15" MacBook Pro. I've also tried to replicate the problem on four PowerMac G5s running OS X 10.5.8 with Photoshop/Bridge CS4, with the same drives plugged in, but have experienced no problems at all. It's quite bizarre.
    Also, looking deeper into the conundrum, I find that I can't input any numbers, only letters! Using the keyboard all numbers, whether on the main or auxiliary keypads, cause the File Info dialogue box to either jump to a new tab or close. Using Shift on the numbered keys works perfectly however!
    It just goes on getting better...

  • File transfer problem

    I have a 2009 intel iMAC running 10.6.8.  Several months ago it developed a file transfer problem.  When transferring files to an external server via ethernet cable, most of the time it will only let me transfer one file at a time whether is a small word document or a large video file that is several gigabytes.   Even with transferring just one file, the elapsed time bar will not indicate the file has completely transferred.  It stays open and appears as if it is still trying to transfer even though the file size transferred is equal to the size of the file.  Plus the only way I can close the the transfer bar is to relaunch finder.  Then when I go to the folder it was transferring it to, the entire file will be there.
    Suggestions?

    Have you tried restarting the external drive and the computer?

  • 10.8 Server file sharing problem

    We have a new Mac mini with 10.8 and OS X Server app. The mini has direct attached storage and will be used mainly for File Sharing. There is a repeatable problem/bug with case sensitive folder names and file sharing. For example a folder named "Editorial" is inacessible via "Connect to Server" from a client on the LAN. The same folder with the same permissions, same everthing, except it is named "editorial" works perfectly. Change the uppercase E to a lowercase e and it works. The drive is formatted with normal HFS+. It is Not HFS+ case-sensitive. I have Xserves running 10.4, 10.5, and 10.6 for file sharing and none have this problem.
    Has anyone else experieced this? Is there a fix? Other than making everything lowercase.

    Simon Slavin United Kingdom
    If you have a problem please start a thread of your own.  Don't get us confused between solving two different problems.
    Simon,
    The subject of this thread is dealing with:
    "Server 10.8 file sharing problem"
    Specifically for direct attached storage file sharing permissions issue.
    Client computers having issues with folder permissions
    These are exactly my issues as well. I was hoping to try a solution here or maybe proffer a solution if found elsewhere.  I did not realize each problem should be opened as a separate discussion....
    Sulking back into the shadow...

  • File sharing problems with my Media Player, an A C Ryan

    I have a media player, an A C Ryan, hooked up to my wifi at home and it normally accesses all my hard disks that is plugged and shared on my iMac. I had no problems when the iMac was on Snow Leopard. Under Network/Workgroup in the AC Ryan's menu, I can see and access all the files on the hard disks.
    The moment I upgraded to Lion, all such access was lost. The AC Ryan cannot connect to the hard disks any more via the wifi network. it's as though file sharing has stopped completely. I checked the file sharing settings on the iMac and nothing has changed i.e. the disks were shared as usual. After struggling with many possible solutions and failing (I checked out a lot of forums), I reintalled Snow Leopard and the problems were immediately solved.
    Is there something seriously wrong with Lion's file-sharing? Has this been fixed in 10.7.2? My friend who has a similar setup (his media player is the WD Live) has exactly the same file sharing problem with Lion.
    I would appreciate any feedback. Thanks!

    I believe that NTFS-3G has issues with Lion.
    I use Paragon NTFS and have had no issues at all. I am pretty sure that NTFS-3G will get updated, but you need to check their site to find out when.

  • Dynamic html file generation problem

    I have a HTML file(abc.html) which is used when user clicks on a particular link in my web application. Web application has been developed in java. Now due to certain law changes , user wants to add some notices to existing HTML file(abc.html). So when he clicks on the old link, he gets abc.html with those notices appended to it. All the notices are different HTML files.
    So it looks like simple file append problem. But if it will modify my original file permanently, then it is not helping my purpose.
    So my doubt is , how I can append different notices html files to abc.html file and still keep my abc.html file as it is because the changes are based on user conditions. So if X is affected with new laws, he will see abc.html along with notices , if Y is not affected, then he will see abc.html only.

    The best solution would depend on the implementation details of your current web app, but, likely, the easiest way is to convert your html files to jsps. The jsp can then conditionally include relevant disclaimer fragments.

  • PDF 'File Save' problem in Firefox

    Using Firefox browser, when I select a PDF file that opens in a new window [rather than a new tab], save it and close the window, the AcroRD32.exe process is not stopped.  If I then open another PDF file in a similar manner, it can not be saved.  Each time you close a PDF window, you have to go to Task Manager and stop the AcroRD32 process before being abl;e to save a subsequent document.  This does not happen with IE.
    Using Reader 10.1.1 and Firefox 8 on a Windows Vista32 system.

    Same bug i see in Opera browser. PDFs doesn't saves without stopping AcroRd32 process. And save dialogue doesn't appears when clicking links (even if web browsing function deactivated in adobe reader settings)...
    Apart from this File Save problem, there is more strange things while browsing PDF online, like "blinks", hangs, image dissapear, suddenly lags without any reason, browser crashing and more...
    So, because adobe reader prevents to download PDFs, and because it works very buggy with online browsing, especially if website uses adobe flash to show PDFs, the only right solution i found is uninstalling adobe reader. After that File Save problem was gone!

  • Flat-File Loading problem

    Hi Friends,
    I am struggling with flat-file loading problem. I am trying to load a .csv file into data target. I took all pre-cautions while loading data. I look into preview and simulate the data. Everything is ok, but when i schedule the data, i found 0 records in the monitor. The following is the STATUS message of the above problem:
       No data available
    Diagnosis
    The data request was a full update.
    In this case, the corresponding table in the source system does not
    contain any data.
    System response
    Info IDoc received with status 8.
    Procedure
    Check the data basis in the source system.
             Can anybody help me what is the problem and procdure to resolve it?
    Regards,
    Mahesh

    Hi Eugene,
    Thanks for the quick reply. The following screen-shot tells you the messages of detail tab;
    OVER ALL STATUS MISSING WITH MESSAGES OR WARNINGS
    REQUEST: MISSING MESSAGES
    EXTRACTION
    EVERYTHING IS OK
    DATA REQUEST RECEIVED
    NO DATA AVAILABLE DATA ELECTION ENDED.
    PROCESSING
    NO DATA
               The above message was shown in details tab. Pls guide me to locate the problem.
    Regards,
    Mahesh

  • Constant file permission problems

    Hello out there..
    I'm currently trying to sort out a problem with - what I guess is my - file permissions.
    The problem reappears, even after a long disk repair session, where loads of issues are found and repaired.
    At the end it says everything is ok, but if I click repair again, it starts again , and even after restart, the problem is back again?!?!
    I've set my permission as follows, (to those of you who doesn't speak Danish - it's "read & write"), but it still says I have "special access"?
    Why? and what can I do to fix it..
    Please help me..
    Michael

    Michael Abel wrote:
    Hello out there..
    I'm currently trying to sort out a problem with - what I guess is my - file permissions.
    The problem reappears, even after a long disk repair session, where loads of issues are found and repaired.
    Disk Repair or Permission Repair?
    Long list from a Permission Repair that come back is normal. Nothing wrong. See http://support.apple.com/kb/ts1448
    Long lists of problems from a Disk Repair that keep coming back is bad news. Likely failing disk.
    Special Access means you have Access Control List entries set for the particular directory/file.
    Did you every change permissions and then "Apply to Enclosed?"
    Do you actually have file access problems, or are you just repairing permissions and think the long list indicates a problem?

Maybe you are looking for

  • When I open safari I get a blank white screen.

    When I open safari I get a blank white screen. When I open top sites, and choose google, the screen is still blank, with the search bar at the top a quarter full. If it does open, it suddenly becomes unresponsive and returns to that blank, white scre

  • Cannot Wi-Fi Sync iPad; Appears to see iMac but iMac does not see the iPad

    Like many, I have upgraded my iPad (1st Gen) to iOS 5 and for the most part, it's been an easy transistion to learn the new features. However, I've not been able to overcome a Wi-Fi Sync issue. The iPad does recognize that it can Wi-Fi Sync with my i

  • Info on how to make application cluster aware

    Hi All, Can somebody provide help/pointers on how to make (java or c++) application cluster aware ? In our application We are making cluster of two solaris m/cs for higher availability.The application which are running on the m/c are written in java

  • Is their a "feature" where the phone doesn't ring while in a pocket or purse?

    I have a friend that is saying her iphone won't ring when in her purse or pocket, but rings all other times. Is this normal behavior? She is saying she knows others that have the same issue. I have never heard of this nor experienced this problem mys

  • Two different WCS instances, pointing to the same database

    Hi, for some unknown reason that came from the architecture fellows, I need to install 02 instances of WCS pointing to the same database server. I mean, both instances would need to "share" the database. They don't want a cluster schema because they