[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Renaming the existing folder name in air application

Posted on 2011-05-09
3
Medium Priority
?
495 Views
Last Modified: 2012-05-11
Hi,

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



Thanks & Regards
0
Comment
Question by:SreeramojuPradeep
  • 2
3 Comments
 
LVL 29

Expert Comment

by:dgofman
ID: 35724512
var sourceFolder:File = File.applicationStorageDirectory.resolvePath("Test");
if(!sourceFolder.exists)
      sourceFolder.createDirectory();
trace(sourceFolder.nativePath);
try  
{
      var destinationFolder:File= File.applicationStorageDirectory.resolvePath("Test2");
      sourceFolder.moveTo(destinationFolder, true);
      trace(destinationFolder.nativePath);
}
catch (error:Error)
{
      trace("Error:" + error.message);
}
0
 

Author Comment

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

Accepted Solution

by:
dgofman earned 2000 total points
ID: 35729998
Please read documentation of File class

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html

"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."
0

Featured Post

[Video] Create a Disruption-Free Workspace

Open offices have their challenges. And Sometimes, it's even hard to work at work. It's time to reclaim your office and create a disruption-free workspace. With the MB 660, you can:

-Increase Concentration
-Improve well-being
-Boost Productivity

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses
Course of the Month18 days, 23 hours left to enroll

834 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