Check if folder is writeable

Hi all,
I have an air app which runs fine. My only concern deals with soem folder I ask user to pick.
Some folders that I think are system protected lead my application to fail.
For example, any subfolder of the opt folder on my mac.
So I am searching without luck how to check if the selected folder is writeable or not ? Any insight ?
Thanks in advance,
Loic

Hello,
there is no api to test for attributes (like canRead/canWrite/isHidden/etc). You could cast your vote here:
http://ideas.adobe.com/ct/ct_a_view_idea.bix?c=9D564F43-979A-4E35-AA21-85A61B6AB8DE&idea_i d=852B26FE-E642-428B-A8F8-1A6E7284FDC5
Existing solutions:
#1
do runtime error check with try/catch or by listening to appropriate error events that can be broadcasted by given operation (move/copy or write etc). If I'm not wrong there is runtime specific error for media which is read-only.
We have to check for runtime errors as "read/write" of directory is not exactly the same if application has appropriate privileges to do I/O operation with given directory.
#2
when you try to "open" FileStream for "WRITE" on in synchronous mode (so not openAsync) it will throw immediate runtime error when application cannot open filestream for "WRITE" mode:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/filesystem/FileStream.html #open()
I don't think that is recommended way to test-by-action if directory is writable - but would work anyway if you're implementing writing feature into selected directory
#3
you could asynchronously use NativeProcess to run system shell functions:
[code]
ls -lo <YOUR_PATH_HERE_QUOTED_IF_REQUIRED>
to see what are attributes of path selected by user. This data would arrive asynchronously and would require you to parse it as it arrives in format like:
rwxr-xr-x@ 3 $USER  staff  102 Jun  5 12:38 /opt
(related api for Windows is ATTRIB)
hth,
kind regards,
Peter

Similar Messages

  • Webutil check if folder has write privilidges

    We need to check if a file has write privileges before writing to it using the webutil transfer.
    I tried WebUtil_File.File_Is_Writable but it shows as TRUE even though it isn't. I know its not writeable as the same location then gives me a
    WUT-105 Unable to open file for writing message if i try and transfer a file from AS to Client.
    My aim is to simply replace this message with one the user will understand.
    Is there anyway to capture the error? or check file folder privileges?
    I also want to check the registry for read/write privileges for the same reasons but can not see any function to do this.
    We use AS 10.1.2.3
    Thanks
    Edited by: ngac_uk on 26-Jan-2012 03:33

    the windows user doesnt have access rights to that folder. If tey log in as an administrator it works fine.Ah, now I understand. There is no WebUtil method to check user permissions, but you could create a Windows script that checks the permissions and writes TRUE or FALSE to a file. Then use Client_Text_IO to read the file.
    Take a look at Microsoft Knowledge Base article How to use Xcacls.vbs to modify NTFS permissions. This article shows you how to read the permissions (as well as modify them).
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • High memory use when checking downloads folder through browser

    High memory use when checking downloads folder through browser.
    I have a total of 3 DDR2 Gbytes of ram. Pentium(R) Dual-Core CPU T4500 @ 2.30GHz Win 7 home pr. 64bit. Firefox 27.0 beta
    I right click on a file to "open containing folder" from the drop down menu in downloads.
    When the folder has been opened, explorer is trying to index the folder (which it never does completely or well after 5 minutes I close the folder and shut down the dllhost process cause laptop is blazing hot) and memory keeps increasing till no more is available.
    I checked task manager and see that dllhost is the particular process that is causing the spike in memory usage even after closing the folder I right click and stop the process and memory is restored after awhile.

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * On Windows you can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac you can open Firefox 4.0+ in Safe Mode by holding the '''option''' key while starting Firefox.
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • My password is no longer working.. I did NOT change it. I requested that it be re-rest and it would email me the steps to re-set. I've done this several times... I dont get the email w/ instructions.. Ive checked spam folder also.. please help

    my password is no longer working.. I did NOT change it. I requested that it be re-rest and it would email me the steps to re-set. I've done this several times... I dont get the email w/ instructions.. Ive checked spam folder also.. please help

    You can send iTunes an email about your password and they can reset it on their end and email you the temp password. When they reset the password they usually make it something generic like Apple06.11
    You can email them here: http://www.apple.com/support/itunes/contact.html?form=el&topic=Express%20Lane%20 inquiry
    If they don't get back to you, you can also call AppleCare: 1-800-275-2273 and see if they are able to reset.
    Hope that helps.

  • My toshiba external hard drive is not being recognized, except when I eject it. I have the preferences checked to show icon and have checked utilities folder. nothing. Help!

    I have a iMac, Yosemite 10.10 and my toshiba external hard drive is not being recognized, except when I eject it!. I have the preferences checked to show icons and have looked in the utilities folder..nothing. I have also changed ports. ??

    A few things to try:
    1-Repair permissions and restart your computer.
    2-Zap the PRAM
    3-Use Software Update/App Store to update your OS to OS 10.10.3.  Also, update everything SU/AS has to offer for your computer.  When done, repair permissions and restart your computer. 

  • URM How to set default value in the "New Check-in" - "Folder" field

    Hello everyone,
    I'm trying to find out how to set the default value for the "folder" field in a check-in profile created using the Configuration Manager. If I browse to the folder in the "Browse Content -> Folders" menu and check-in a file inside the folder, it will fill this field automatically. I need to replicate this behavior using the "New Check-in" drop-down menu and selecting a profile, in other words, associate a Folder with a check-in profile.
    I know it was possible to do so in previous versions using the folders_g component, but I'm unable to figure out how to accomplish it with the new FrameworkFolders component.
    Any help is greatly appreciated.
    Thank you.

    Hello,
    It is working fine try this.
    PARAMETERS :
    y_p_list TYPE char32  AS LISTBOX VISIBLE LENGTH 22
                                  MODIF ID rsg. .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR y_p_list.
      MOVE: text-200 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE  text-203 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE  text-210 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE  text-211 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE  text-204 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE text-205 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE text-206 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE text-207 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      MOVE text-208 TO y_wa_listbox-field.
      APPEND y_wa_listbox TO y_i_listbox.
      CLEAR y_wa_listbox.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'FIELD'
          dynpprog        = sy-repid
          stepl           = 1
          value           = ' '
          value_org       = 'S'
          display         = ' '
        TABLES
          value_tab       = y_i_listbox[]
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
      ENDIF.
      REFRESH y_i_listbox.

  • Batch file for checking every folder

    hello friends,
    i have query  in creating batch programming.
    i have lot of folders in my local drive.
    i want to create a log file in every folder but log file is already available in some folders.
    i need a program that follow bellow steps.
    1. check the folder1 if log file is not available means to create the new log file and go to the next folder for same.
    2. if available means go to next folder check the same.
    the program check one by one folder based  on above condition.

    function Recurse-Folders([string]$path) {
    $LogFile="Log.txt"
    Set-Location -Path $Path
    $L=Get-Location
    IF (Test-Path -path $Logfile)
    Write-Host "Log File Exists in "+$L.Path
    ELSE
    Write-Host "Creating Log File in "+$L.Path
    Add-Content $LogFile "Log File Contents"
    [String[]]$Folders = Get-ChildItem "." -Directory
    ForEach ($F in $Folders)
    Recurse-Folders($F)
    Set-Location -Path ".."
    CD C:
    CD \
    MD \Test
    MD \Test\Test1
    MD \Test\Test1\Folder1
    MD \Test\Test1\Folder2
    MD \Test\Test1\Folder3
    MD \Test\Test1\Folder4
    MD \Test\Test1\Folder1\SubFolder1
    MD \Test\Test1\Folder1\SubFolder2
    MD \Test\Test1\Folder3\SubFolder1
    MD \Test\Test1\Folder3\SubFolder2
    MD \Test\Test2
    MD \Test\Test2\Folder1
    MD \Test\Test2\Folder2
    MD \Test\Test3
    MD \Test\Test3\Folder1
    MD \Test\Test3\Folder2
    Recurse-Folders("Test")

  • Thunderbird crashed after checking profile folder, now no accounts

    I was checking the Troubleshooting to locate the Profiles folder to back up. I clicked on "about plugins" to see if there were any plugins installed by default and TB crashed. It would not restart until I restarted the computer, then when launched it wanted to created an account. Both accounts previous created were gone. I found the profiles folder and it has 2 folders with random nos in the titles. I tried the command line profile manager and created a new profile with choosing the copied folder I had. TB would not start. When I chose a subfolder beneath Profiles it did start and my 2 accounts were back with the emails and folders I created. I went to the Troubleshooting again and clicked on the about link and it happened again!
    Should I remove and re-install TB again to be safe? What is the best way to backup the emails? I could not find where you would import old emails from either TB or Outlook. We have a backup of emails from our work computer we need to import on the laptop eventually. I need to work this out before I install TB on our laptop that has an email account with many old emails that need to be kept. We are trying to get away from using the AOL Desktop application!

    reinstalling does not effect mails or any other data as the profiler is not changed by the process.
    If it crashed there should be a crash it for someone to look at, Could you post it.
    The plugin information is all retrieved from the registry and is basically shared with Firefox. Unless you modify it you will have none active in Thunderbird. If you do not have Firefox installed however it might be there is no registry hive to read causing the crash. Are you using Firefox or have it installed.
    Go to this link and see what is installed. https://www.mozilla.org/en-US/plugincheck/

  • Installed ff4 (earlier had ff3.6 and ff4beta) and when i launch ff4, error "Profile is inaccessible and cannot be loaded". I checked profiles folder, but there is nothing in that folder except "Crash reports". Now I Cannot use any version of FF

    ''locking as a duplicate - https://support.mozilla.com/en-US/questions/817817''
    Same as above

    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html ( http://adobe.ly/19llvMN )

  • How to check folder availability in BODS?

    How can we check if folder is present for the target file in BODS in linux system?

    Use some thing like below  for your folder path in script
    print(exec('ls',' -l /parent_folder/child_folder/sub_folder'));

  • Convert to Apple TV from Drop folder with checking?

    I'm trying to create a script for use on set. When rushes come off the camera I process offlines with the render software to H264 for quick viewing. I'm looking for a script that will monitor the folder these drop into and then reconvert them to apple tv and drop them in turn into another folder where air video server, serves them to ipads and iphones on set for fast reviewing of shots.
    My issue so far seems to be that if my camera-raw to h264 software hits a couple of short clips (B&C) immediately after a long clip (A), then the automator quicktime action is still encoding the A when B+C are dropped into the folder. When Automator next check the folder it seems to only find the most recent clip C skipping clip B. For a while I thought I had a workaround by telling it to pass finder items created in the last 1 day, but that too seems to have stopped working.
    If anyone that better understands the finder / quicktime elements of automator could help me on this it would be most appreciated as I really do need to find a robust workflow that can for example check the number of items in the input folder against output folder and automatically encode anything missing.
    I hope i've explained what it is I'm doing clearly but feel free to ask any questions.

    http://support.apple.com/kb/HT5404?viewlocale=en_US&locale=en_US
    Take a look at the above support dicument. You have to have an iMac model that supports AirPlay in order to do what you want to do. The document also shows you how to use AirPlay to connect your iMac to your Apple TV.

  • 'The folder path "C:" contains an invalid character.' ERROR AS I INSTALL iTunes

    hi
    first of all, merry xmas to all that celebrate! i hope you had/have a memorable day!
    and wishing everyone the very best for the new year.
    Now, I have a problem when I try to install iTunes on my computer. I'm running:
    - Windows Vista (Home Basic)
    - iTunes 10.5.2.11
    i have sufficient hard-drive space and sufficient ram. its definetly NOT from that. I originially DID HAVE iTunes already installed on my computer, but I was frequently having problems with establishing a connection through my iPhone 4. So I thought it would be a good idea to delete it and try downloading a new version, then install it fresh!
    I have some computer skills and knowledge, and i know how "most" things work and run. But now I am totally stuck. I run the iTunes software to be installed, but the installer keeps giving me an error message and NOT installing. I've done all the easy and required steps after I deleted the original version of iTunes from my computer, and now I need help from someone who really knows their stuff in IT and computer software. I have a feeling it may be a string of codes that are corrupt or significantly different to what they should be, but thats just my guess! cos like i already said, ive tried all the common fixes already but have been unsuccessful thus far. Some of the things I did were:
    - Restart the computer, re-boot, login to Windows, run the iTunes installation
    - Turn off the computer, wait 10 minutes, re-boot and then run the iTunes installation
    - Delete ALL the "Apple" company software that was still installed on my computer (QuickTime, iPhone Utility, iPod, Bonjour, etc etc)
    - Confirm my "User Account Control" is OFF
    - Run the iTunes installation file from my secondary windows login account (which has "Administrator" privilages)
    - Create a new windows login account, turn off the UAC (User Account Control protection), then try installing iTunes
    - Run disk-error checks on my hard-drives incase there are missing/corrupt/misplaced files that needed repair
    etc etc etc etc
    Nothing worked! THIS BELOW IS EXACTLY THE PROBLEM I KEEP GETTING WHEN I DOUBLE-CLICK ON THE iTUNES INSTALLER:
    - Double click on the iTunes install icon
    - The "Trusted File Security Warning/Confirmation" window appears, requesting I confirm to Run or Cancel the software installation. I click on "Run"
    - A horizontal grey bar appears in the middle of the screen, and quickly fills up green
    - Then a small installation windows appears (Windows Installer) that writes "Preparing to Install". Then it very fast writes a couple different sentences (which is normal), specifically the sentences are "Performing installation checks" and "Checking spacing requirements".
    - immedietly after the previous step, another window appears and I hear the "error" audio tone. The ERROR MESSAGE has the Yellow Triangle logo with an exclamation mark in the middle, and beside it displays the following text (and Ive attatched the screen shot too):
    THE FOLDER PATH "C:" CONTAINS AN INVALID CHARACTER
    then below this message theres the "OK" button which I have no choice but to click on. then the next window that appears is as follows (see screenshot), and it reads:
    iTunes Installer Completed
    The installer encountered errors before iTunes could be configured.
    Errors occured during installation. Your system has not been modified.
    Please run the installer again, or click Finish to exit
    Please I beg you guys to help me, I will be extremely grateful for ALL and ANY advice/tips/assistance/solutions I receive. And would owe you one for sure!!
    Please feel free to write your opinions and thoughts on what I could do different, as Ive used up all my knowledge regarding the matter, and have seriously hit a brick wall now.
    Thanks so so so much, and once again I wish everyone the absolute very best!
    regards.
    PS. Replies can be posted in this thread, otherwise even sent to me via email if you wish to do otherwise. My email address is:  [email protected]
    cheers

    Resolution:
    Check for the existence of a hidden folder named %appdata% in the C:\Program Files\Microsoft Application Virtualization\Client folder.  (You will need to un-check the folder options box in windows explorer for "Hide
    protected operating system files" to see it)
    If the hidden %appdata% folder exists, delete it.
    Proceed to uninstall the App-V client
    After a clean uninstall and removal of remnants of the client, reinstall the client again and apply the latest hotfix available (Hotfix 2 for SP2 at a minimum).

  • Folder Icons not displaying in a new folder

    Hello All,
    I created a new folder and moved icons into it. I used it for several days with no issues. Now, when I open the folder I can't see any icons. When I open the folder "Options" is listed at the bottom. When I click the menu button, my only option is "switch application." I expected to see the menu with "move, hide, show all" but its not there.
    If I leave the new folder open, after about 60 seconds the folders do come into view and the normal menu is displayed when I press the menu button.
    Why does it take so long for the folders to show up and does anyone know how to make it stop ? It didn't do this a few days ago.
    THANKS

    This happened to me and another user here before. When I clicked on the folder it said options on the bottom and when I hit the back key the icons appeared for a quick second and then it would go back to my homescreen. Try pulling the battery out with the phone on and leave it out for 30 seconds. Replace it and allow 1-3 minutes for the phone to reboot. Then check the folder again. This worked for me and the other user as well. Please let us know if it helps you too.
    ~Lorrie~ Master of All Things Blackberry!

  • Event Receiver to get folder Names from List View Web Part

    Hi,
    We have a requirement i.e.
    On one of the page,there are some folders on the list view web part.
    Now through event receiver i should pick the folder names from list view web part and
    update the same in the list.
    If that names already exists in the list then we should leave without updating,if not we have to add folder name in the list.
    Please share your ideas regarding the same.
    Regards,
    Naga Sudheer M
    Thanks & Regards, Sudheer

    Hello,
    LVWP is just for displaying content of site so you need to associate your event receiver with actual list/library. You can create ItemAdded event receiver to check existing folder and create new if not existing. "sk2014" links are good to start.
    http://sharepoint.stackexchange.com/questions/59788/change-name-in-itemadding-event-receiver-or-create-a-new-item
    Let us know in case any doubt
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Error when uninstalling App-V RDS client: Product: Microsoft Application Virtualization (App-V) Client for Remote Desktop Services 5.0 Service Pack 2 x64 -- Error 1324. The folder path 'C:' contains an invalid character

    Issue:  experienced when attempting to uninstall the App-V 5.0 SP2 RDS client. 
    Event Log:  Product: Microsoft Application Virtualization (App-V) Client for Remote Desktop Services 5.0 Service Pack 2 x64 -- Error 1324. The folder
    path 'C:' contains an invalid character
    Symptoms (when in this current state): 
    Unable to uninstall the SP2 client
    You can upgrade the client (via hotfix) and uninstall the hotfix, but you will not be able to remove the SP2 client
    AppvVfs filter driver will not create an instance, therefore applications will not be able to read into existing streamed VFS content, or trigger sparse files to stream content.  (you can still stream the content via other means, like the UI or powershell)
    Because of the AppvVfs filter driver not instantiating, applications that depend on licences that exist in VFS will not be able to be read causing certain applications to react as if the license does not exist or is an incorrect format

    Resolution:
    Check for the existence of a hidden folder named %appdata% in the C:\Program Files\Microsoft Application Virtualization\Client folder.  (You will need to un-check the folder options box in windows explorer for "Hide
    protected operating system files" to see it)
    If the hidden %appdata% folder exists, delete it.
    Proceed to uninstall the App-V client
    After a clean uninstall and removal of remnants of the client, reinstall the client again and apply the latest hotfix available (Hotfix 2 for SP2 at a minimum).

Maybe you are looking for