Renaming the existing folder name in air application

Posted on 2011-05-09
Last Modified: 2012-05-11

Can u let me know how to rename the folder name from within air application in flex4.................................

Thanks & Regards
Question by:SreeramojuPradeep
    LVL 29

    Expert Comment

    var sourceFolder:File = File.applicationStorageDirectory.resolvePath("Test");
          var destinationFolder:File= File.applicationStorageDirectory.resolvePath("Test2");
          sourceFolder.moveTo(destinationFolder, true);
    catch (error:Error)
          trace("Error:" + error.message);

    Author Comment

    U mean renaming the folder or file is not possible...but instead we can use moveTo by deleting the previous folder....
    LVL 29

    Accepted Solution

    Please read documentation of File class

    "To rename a file, set the destination parameter to point to a path that is in the file's directory, but with a different filename."

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
    Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now