File exists needs an unconditional outgoing transition

Hello All,
I am just starting to play with process flow, OWB 10.2.0.1.
On file exists activity I would like to proceed if file exists or send an email and stop the process if it doesn't. When I set condition as missing and exists on transitions I get "Activity needs an unconditional outgoing transition condition to ensure the process flow doesn't stall". What am I missing? Can not find anything in Help or User's guide.
Any help and comments appreciated.
Regards,
Vlasta

I think I got it, file exist has three conditions and seems to be working fine when three outgoing transitions are set to cover missing, exist and some exist.
Cheers,
Vlasta

Similar Messages

  • Process flow Activity File Exists

    Hi
    Software: warehouse builder 11.1.0.7
    OS: Redhat 5.5
    DB: 11gR1
    I am trying to use the activity "File Exist" on a process flow to know if a file does exist, with two transitions
    one with condition "EXISTS" that ends in success and one with the condition "MISSING", when the file
    exists the process flow acts normal with end success, but when the file doesn't exist the process flow
    just hangs and doesn't finish.
    Am i missing some configuration?

    You have to provide multiple transitions (arrows) out of the file_exists activity and the define the transition conditions (in the transition view section of the window) for success and error. In that case, if the file exists, the flow will continue along the sucess transition path, if it doesn't it will continue down the ERROR path. The error path can then end up into an END_ERROR activity and that will make the process flow stop if the file is not found, just your expected behaviour.
    If you have only a single unconditional transition (arrow) out of the file_exists, the process flow will continue regardless of the FILE_EXISTS activity.
    Regards:
    Igor

  • How to check if a specific file exist and which exit code to use ?

    Hi, First I'm not a scripting guy and I know almost nothing about VB scripting.
    I have a deployment of 6 tasks and I want to make sure that step # 2 will not be process if it failed in step #1, and so on for the 6 task.
    To do this, i have to run a vb script before installation or uninstalltion on each steps
    I'm trying to use a script (not from me) that i have modified for pre-uninstallation of software and also post-installation of the software.
    Pre-uninstallation: The script will look if the specified "exe" exist on the server and if so, than it will run the msiuninstall "application_name".
    If the uninstallation is successful, the post-installation script will check if the "exe" file exist again on the server, and it shouldn't find it (because it was deleted from the uninstallation), than it will return an exit code of successful
    to run the next process.
    Here an example:
    Step 1: Uninstall "Software#1" with msiuninstall Software#1.exe command
    Step 2: Uninstall "Software#2" with msiuninstall Software#2.exe command
    Step 3: Install "Software #3"with an .exe extension
    Step 4: Re install "Software #2" with an .msi extension
    Step 5: Re install "Software #1" with a .msi extension.
    Step 6: Send email to confirm the deployment is successful
    So i need to validate that step #2 will not process step #3 if it failled on # 2. It need to validate if the file exist before and after.
    At the end, Step 6 should send an email to confirm that the 6 steps of the deployment was completed without errors.
    Any idea how to do it ?
    Many many thanks for all the help !
    A desperate guy :)
    This is what i have
    'This script will look if an .exe file exist for a specific application.
    '=============================================================================================
    path = WScript.Arguments.Item(0)
    set objFSO = CreateObject("Scripting.FileSystemObject")
    If objFSO.FileExists(C:\Inetpub\wwwroot\Enterprise\EnterpriseWS\web.config) = true then
        exitCode = 0
    else
        exitCode = 1
    End If
    Wscript.Quit exitCode

    Since you are not a scripting guy here is a very good place to start:
    http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
    ¯\_(ツ)_/¯

  • Error when running reports: "File Server needs to be re-initialized"

    Hi.
    This error "File Server needs to be re-initialized" appears when our users try to run reports on 11.5.10. EBS.
    There is also a message box that appears and reads:
    "A error occurred while attempting to establish a conection to Application File Server. There may be a network configuration problem, or the TNS listener may not be running."
    This is a problem in our test environment. We recently ran autoconfig on the test side.
    I have checked Metalink and also wider google search.
    Perhaps we have an issue with the tnsnames files? Well, I verified this and the tnsnames in production and test, and they are the same.
    Perhaps a listener.ora file issue?
    "The issue is caused by the variables APPLFSTT and APPLFSWD is not being set properly in the <8.0.6_ORACLE_HOME> listener.ora file. " (Note 263654.1)
    I am trying to verify the meaning of the following (in listener):
    ( SID_DESC = ( SID_NAME = FNDFS )
    ( ORACLE_HOME = /oracli2/oracle/testora/8.0.6 )
    ,APPLFSTT=
    TEST_BALANCE;TEST;PROD_806_BALANCE;TEST_FO;TEST_806_BALANCE;PROD_FO,APPLFSWD=/or
    acli2/oracle/testappl/admin;/oracli2/oracle/testcomn/temp;/oracli2/oracle/testco
    mn/html/oam/nonUix/launchMode/restricted' )
    In the APPLFSTT entry, should there be any mention of "PROD" ? Shouldnt this all be changed to TEST?
    Also, comparing this to the PROD listener, the order of APPLFSTT is different:
    TEST: APPLFSTT=
    TEST_BALANCE;TEST;PROD_806_BALANCE;TEST_FO;TEST_806_BALANCE
    PROD:APPLFSTT=
    PROD_806_BALANCE;PROD;PROD_BALANCE;PROD_FO,
    I have made a copy of our listener in TEst, so I can edit the existing one. Trouble is, not sure if I even should try to edit it!
    Any suggestions, much appreciated.
    Oracle 9.2.0. AIX 5.2.
    Notes covered in Metalink:
    274177.1
    303971.1
    304568.1
    263654.1

    Yes thanks for that. Metalink has informed me to do the same, basically.
    But I am in the middle of a cloning, so I will finish that then run autoconfig once again.
    I already ran Autoconfig on both source and target, so will do again once this process is over.
    Cheers.
    DA

  • File exist/file not exist

    OK, i create a directory i have read/write permissions on the directory, but still even if the file exists its bringing back the result as if it doesnt i need help with this...
    set serveroutput on
    DECLARE
    fexists    BOOLEAN;
    flen  NUMBER;
    bsize NUMBER;
    BEGIN
    sys.utl_file.fgetattr('TMP_LOCATION', 'test.txt', fexists, flen, bsize);
      IF fexists THEN
        dbms_output.put_line('File Exists');
      ELSE
        dbms_output.put_line('File Does Not Exist');
      END IF;
      dbms_output.put_line('File Length: ' || TO_CHAR(flen));
      dbms_output.put_line('Block Size: ' || TO_CHAR(bsize));
    END fgetattr;
    File Does Not Existmy directory.. CREATE or replace DIRECTORY tmp_location AS 'Server-1\configsheets\completed\pdf approved'

    Good afternoon,
    If you are loooking at a mapped drive, you can only see it if you change how the Oracle services start. You need to have them start with a specific user ID rather than starting as system services. The problem is that the system services cannot see mapped drives.
    So, do this:
    <li>Create a user to be used by Oracle services. Make sure they have the correct rights (I gave mine Server ADMIN so as to have all the access I needed)
    <li>Log into the server and modify the services
    <li>Click the 'Log On' tab and enter the account and password you created for the Oracle Processes
    <li>Reboot the server, allowing the Oracle services to log in with this new ID.
    This should then fix your problem.
    Thanks,
    Don.
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! :)

  • Dialog prompt and check if file exists, and use the result of dialog

    I have this working script and I want to change the way it behaves.
    I want a dialog to come up, Do you want to skip or replace existing files.
    Then the result  of the dialog to be used in the reast of the script.
    I've added it in the script where I need to use it. in noce big letters, hopefully its not a big job.
    Many thanks
    property type_list : {"8BPS"}
    property extension_list : {"psd"}
    script o
              property theseNames : {}
    end script
    -- empty log file
    do shell script "echo  'Files not processed in Photoshop :'  > ~/Desktop/LogPhotoshopError.txt"
    set noError to true
    --Setup list of folders and process details of folders
    set dtF to paragraphs of (do shell script "ls -F ~/Desktop | grep '/' | cut -d'/' -f1")
    set tc to (count dtF)
    repeat with i from 1 to tc
              set folderName to item i of dtF --<:  is the folder name, no need to use text item delimiters -->":"
              if folderName does not start with "2_" and folderName does not start with "Hot" and folderName does not start with "Press" and folderName does not start with "Design" and folderName does not start with "Keywords" and folderName does not start with "Season" and folderName does not start with "Sue" and folderName does not start with "Design" then
                        set {oldTID, my text item delimiters} to {my text item delimiters, "_WK"}
                        set FolderEndName to last text item of folderName
                        set brandName to first text item of folderName
                        set my text item delimiters to "_PSD"
                        set weekNumber to first text item of FolderEndName
                        set my text item delimiters to oldTID
                        set theFolder to ("Hal 9000:Users:matthew:Desktop:" & folderName)
      --set up names to destination folders and create locally based on brand name and week number
                        set this_local_folder to "Images:2012-2013"
                        set localWeekFolder to my getFolderPath("WK" & weekNumber, this_local_folder)
                        set localBrandFolder to my getFolderPath(brandName, localWeekFolder)
                        set localBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", localBrandFolder)
                        set localBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", localBrandFolder)
                        set localBrandFolder_PSD to my getFolderPath(brandName & "_WK" & weekNumber & "_PSD", localBrandFolder)
                        set this_Network_folder to "GEN:Brands:Zoom:Brand - Zoom:Upload Photos:2013:"
                        set networkWeekFolder to my getFolderPath("Week" & weekNumber, this_Network_folder)
                        set networkBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", networkWeekFolder)
                        set website_images to "GEN:Website_Images:"
      --set up names to destination folders and create over Netwrok for FTP collection (based on a mounted drive)
                        set this_ftp_folder to "pulse:"
                        set ftpWeekFolder to my getFolderPath("Week" & weekNumber, this_ftp_folder)
                        set ftpBrandFolder to my getFolderPath(brandName, ftpWeekFolder)
                        set ftpBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", ftpBrandFolder)
                        set ftpBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", ftpBrandFolder)
      --at the beginning of the script, ask whether to replace or skip existing files? to apply to all?
      --use the result for the if file exists?
                        display dialog "Should I replace or skip exisiting files?" buttons {"Replace", "Skip (Faster)"} default button 2 with icon 1
      --taking the folder identify which process it must follow.
                        if brandName is equal to "BH" then
                                  try
                                            tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
                                  on error
                                            set o's theseNames to {} -- no psd files or "8BPS"
                                  end try
                                  set numOfNames to (count o's theseNames)
                                  repeat with j from 1 to numOfNames
                                            set thefile to theFolder & ":" & (item j of o's theseNames)
      --    B H   Folder Photoshop Process
      --if thefile exists in the folder localBrandFolder_PSD then do the result of dialog.
      --"Skip" the file and move on to next
      --If "replace" continue the rest of the script.
                                            tell application "Adobe Photoshop CS5.1"
      -- I remove the command activate, Photoshop stay in background
                                                      set ruler units of settings to pixel units
                                                      try
      open (alias thefile) showing dialogs never
                                                                set origName to name of current document
                                                                set myOptions to {class:JPEG save options, quality:12}
                                                                set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
                                                                tell current document
      --If the quick mask mode has been left on then delete the channel Quick Mask
                                                                          if (quick mask mode) then delete channel ¬
                                                                                    "Quick Mask"
      --If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
                                                                          if (exists layer "Original Layer") then ¬
                                                                                    tell layer "Original Layer" to set name to "Original Image"
      save in (localBrandFolder_PSD & origName) as Photoshop format with options myPSDOptions without copying
                                                                          (delete layer "Original Image") flatten
      resize image resolution 300 resample method none
      --sharpen image
      filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
      save in (localBrandFolder_High_Res & name) as JPEG with options myOptions without copying
      --get file path, return path of the JPEG file, work with (without copying)
      -- (with copying) : it return path of PSD file
                                                                          set newFile to file path --( return path of type alias )
      -- duplicate file using the Finder  -->on duplicateFile(..)
                                                                          my duplicateFile(newFile, {ftpBrandFolder_High_Res})
      --Prepare for Low RES by resetting image history
                                                                          set current history state to history state 3
                                                                          flatten
                                                                          resize image width 1348
      resize image resolution 300 resample method none
      filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
      --add save to lowResFolder with same options
      save in (localBrandFolder_Low_Res & name) as JPEG with options myOptions without copying
                                                                          set newFile to file path
                                                                          set newFile2 to newFile as string -- for testing end of name
                                                                          if newFile2 ends with "_2.jpg" or newFile2 ends with "_3.jpg" then -- exclude website_images
                                                                                    my duplicateFile(newFile, {networkBrandFolder_Low_Res, ftpBrandFolder_Low_Res})
                                                                          else
                                                                                    my duplicateFile(newFile, {networkBrandFolder_Low_Res, ftpBrandFolder_Low_Res, website_images})
                                                                          end if
      close saving no
                                                                end tell
                                                      on error
                                                                set noError to false
                                                                my myLogs(thefile) -- write path to log file in Desktop
                                                                try
      close saving no --if exists, close current document
                                                                end try
                                                      end try
                                            end tell
                                  end repeat
      --End BH
    -- else if and the rest of the script.....
    end repeat
    if not noError then do shell script "/usr/bin/open  ~/Desktop/LogPhotoshopError.txt'"
    on myLogs(t)
              try
                        do shell script "echo " & (quoted form of t) & ">> ~/Desktop/LogPhotoshopError.txt'"
              end try
    end myLogs
    on duplicateFile(tFile, foldersPath) -- tFile is an alias, foldersPath is a list of folder
              tell application "Finder" to repeat with folderPath in foldersPath
                        with timeout of 200 seconds -- adjust it,  error if the copy  is longer that 200 seconds
      duplicate tFile to folder folderPath with replacing
                        end timeout
              end repeat
    end duplicateFile
    on getFolderPath(tName, folderPath)
              tell application "Finder" to tell folder folderPath
                        if not (exists folder tName) then
                                  return (make new folder at it with properties {name:tName}) as string
                        else
                                  return (folder tName) as string
                        end if
              end tell
    end getFolderPath
    tell application "Finder"
              open "Hal 9000:Users:matthew:Desktop:LogPhotoshopError.txt"
    end tell

    Hi,
    I think that's what you want.
    I put the dialog in the beginning, so it does not appear to each folder, otherwise put it in the loop as it was originally.
    property type_list : {"8BPS"}
    property extension_list : {"psd"}
    script o
          property theseNames : {}
    end script
    -- empty log file
    do shell script "echo  'Files not processed in Photoshop :'  > ~/Desktop/LogPhotoshopError.txt"
    set noError to true
    --at the beginning of the script, ask whether to replace or skip existing files? to apply to all?
    --use the result for the if file exists?
    display dialog "Should I replace or skip exisiting files?" buttons {"Replace", "Skip (Faster)"} default button 2 with icon 1
    set skipFiles to (button returned of the result) is "Skip (Faster)"
    --Setup list of folders and process details of folders
    set dtF to paragraphs of (do shell script "ls -F ~/Desktop | grep '/' | cut -d'/' -f1")
    set tc to (count dtF)
    repeat with i from 1 to tc
          set folderName to item i of dtF --<:  is the folder name, no need to use text item delimiters -->":"
          if folderName does not start with "2_" and folderName does not start with "Hot" and folderName does not start with "Press" and folderName does not start with "Design" and folderName does not start with "Keywords" and folderName does not start with "Season" and folderName does not start with "Sue" and folderName does not start with "Design" then
                set {oldTID, my text item delimiters} to {my text item delimiters, "_WK"}
                set FolderEndName to last text item of folderName
                set brandName to first text item of folderName
                set my text item delimiters to "_PSD"
                set weekNumber to first text item of FolderEndName
                set my text item delimiters to oldTID
                set theFolder to ("Hal 9000:Users:matthew:Desktop:" & folderName)
                --set up names to destination folders and create locally based on brand name and week number
                set this_local_folder to "Images:2012-2013"
                set localWeekFolder to my getFolderPath("WK" & weekNumber, this_local_folder)
                set localBrandFolder to my getFolderPath(brandName, localWeekFolder)
                set localBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", localBrandFolder)
                set localBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", localBrandFolder)
                set localBrandFolder_PSD to my getFolderPath(brandName & "_WK" & weekNumber & "_PSD", localBrandFolder)
                set this_Network_folder to "GEN:Brands:Zoom:Brand - Zoom:Upload Photos:2013:"
                set networkWeekFolder to my getFolderPath("Week" & weekNumber, this_Network_folder)
                set networkBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", networkWeekFolder)
                set website_images to "GEN:Website_Images:"
                --set up names to destination folders and create over Netwrok for FTP collection (based on a mounted drive)
                set this_ftp_folder to "pulse:"
                set ftpWeekFolder to my getFolderPath("Week" & weekNumber, this_ftp_folder)
                set ftpBrandFolder to my getFolderPath(brandName, ftpWeekFolder)
                set ftpBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", ftpBrandFolder)
                set ftpBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", ftpBrandFolder)
                --taking the folder identify which process it must follow.
                if brandName is equal to "BH" then
                      try
                            tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
                      on error
                            set o's theseNames to {} -- no psd files or "8BPS"
                      end try
                      set numOfNames to (count o's theseNames)
                      repeat with j from 1 to numOfNames
                            set thefile to theFolder & ":" & (item j of o's theseNames)
                            --    B H   Folder Photoshop Process
                            tell application "Finder" to set b to exists file (localBrandFolder_PSD & item j of o's theseNames)
                            if b and not skipFiles then -- file exists and "replace" (continue the rest of the script).
                                  tell application "Adobe Photoshop CS5.1"
                                        -- I remove the command activate, Photoshop stay in background
                                        set ruler units of settings to pixel units
                                        try
                                              open (alias thefile) showing dialogs never
                                              set origName to name of current document
                                              set myOptions to {class:JPEG save options, quality:12}
                                              set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
                                              tell current document
                                                    --If the quick mask mode has been left on then delete the channel Quick Mask
                                                    if (quick mask mode) then delete channel ¬
                                                          "Quick Mask"
                                                    --If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
                                                    if (exists layer "Original Layer") then ¬
                                                          tell layer "Original Layer" to set name to "Original Image"
                                                    save in (localBrandFolder_PSD & origName) as Photoshop format with options myPSDOptions without copying
                                                    (delete layer "Original Image") flatten
                                                    resize image resolution 300 resample method none
                                                    --sharpen image
                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                    save in (localBrandFolder_High_Res & name) as JPEG with options myOptions without copying
                                                    --get file path, return path of the JPEG file, work with (without copying)
                                                    -- (with copying) : it return path of PSD file
                                                    set newFile to file path --( return path of type alias )
                                                    -- duplicate file using the Finder  -->on duplicateFile(..)
                                                    my duplicateFile(newFile, {ftpBrandFolder_High_Res})
                                                    --Prepare for Low RES by resetting image history
                                                    set current history state to history state 3
                                                    flatten
                                                    resize image width 1348
                                                    resize image resolution 300 resample method none
                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                    --add save to lowResFolder with same options
                                                    save in (localBrandFolder_Low_Res & name) as JPEG with options myOptions without copying
                                                    set newFile to file path
                                                    set newFile2 to newFile as string -- for testing end of name
                                                    if newFile2 ends with "_2.jpg" or newFile2 ends with "_3.jpg" then -- exclude website_images
                                                          my duplicateFile(newFile, {networkBrandFolder_Low_Res, ftpBrandFolder_Low_Res})
                                                    else
                                                          my duplicateFile(newFile, {networkBrandFolder_Low_Res, ftpBrandFolder_Low_Res, website_images})
                                                    end if
                                                    close saving no
                                              end tell
                                        on error
                                              set noError to false
                                              my myLogs(thefile) -- write path to log file in Desktop
                                              try
                                                    close saving no --if exists, close current document
                                              end try
                                        end try
                                  end tell
                            end if -- else "Skip" the file and move on to next
                      end repeat
                      --End BH
                end if
          end if
    end repeat
    if not noError then do shell script "/usr/bin/open  ~/Desktop/LogPhotoshopError.txt'"
    on myLogs(t)
          try
                do shell script "echo " & (quoted form of t) & ">> ~/Desktop/LogPhotoshopError.txt'"
          end try
    end myLogs
    on duplicateFile(tFile, foldersPath) -- tFile is an alias, foldersPath is a list of folder
          tell application "Finder" to repeat with folderPath in foldersPath
                with timeout of 200 seconds -- adjust it,  error if the copy  is longer that 200 seconds
                      duplicate tFile to folder folderPath with replacing
                end timeout
          end repeat
    end duplicateFile
    on getFolderPath(tName, folderPath)
          tell application "Finder" to tell folder folderPath
                if not (exists folder tName) then
                      return (make new folder at it with properties {name:tName}) as string
                else
                      return (folder tName) as string
                end if
          end tell
    end getFolderPath
    tell application "Finder"
          open "Hal 9000:Users:matthew:Desktop:LogPhotoshopError.txt"
    end tell

  • Checking to see if files exist not working as expected.

    Hey, so I've set up a script that determines the artist playing on iTunes and sets the background image to a preselected picture of them. I want to expand this to allow different pictures of the artists, and after a few attempts, decided to use a time based system. However, some artists have 2 images (named Artist1.jpg and Artist2.jpg), whilst others only have one (Artist.jpg). I can get the scripting right for if all artists have 2 images, yet am having problems with the system determining if certain files exist.
    who is the artist playing, and myNum is either 1 or 2, and changes based on the time, both set earlier in the script and verified to work.
    set MultiWall to ("/Users/ethan/Pictures/Music Wallpaper/" & who & myNum & ".jpg")
    set SingleWall to ("/Users/ethan/Pictures/Music Wallpaper/" & who & ".jpg")
    tell application "System Events"
                       if not (exists MultiWall) then
                                                           tell application "Finder"
                                                                          set desktop picture to file SingleWall
                                                           end tell
                       else
                                                           tell application "Finder"
                                                                          set desktop picture to file MultiWall
                                  end tell
                                            end if
    end tell
    I've tried many variations of this, from less variables to more, restructuring it and whatnot and it just isn't working for me. Thanks all.

    If you are still having difficulties you may like to try this method:
    set myPath to "/Users/neville/Desktop/test" & ".png"
    if (do shell script "/bin/test -e '" & myPath & "'; echo $?") is "0" then
      tell application "Safari" to open myPath
    end if
    It should work if you copy and paste it.
    Please note the combined single and double quotes. Don't put a space between them. You may not need the single quotes if you have control over the path. Most people would opt for 'quoted form of' but I prefer concise code.

  • File exist to check for any file, not just a specific filename

    How can I implement a check to see if any file exists in a certain directory. I don't know the filename beforehand, only the directory.
    Can I still use the FILE EXISTS activity or do I need to write something different.
    Thanks,
    Guido

    Hi guidonlm
    You can use USER DEFINED activity or FILE EXISTS activity. With file exists you must get file name before (file name can be hard coded or passed as variable). With user defined activity you can make your own shell script and check anything that you need (in this case you must enable property in file $ORACLE_HOME/owb/bin/admin/Runtime.properties property.RuntimePlatform.0.NativeExecution.Shell.security_constraint = NATIVE_JAVA
    Regards

  • File.exists()  returs false even the file is present in the specified path

    Hi,
    When i try to run the following program which checks whether the file exists in the given path or not
    public class FileCheck {
    public static void main(String[] a){
    String str = a[0];
    File f = new File(str);
    if(f.exists())
    System.out.println("File Exists ");
              else
         System.out.println("File does not Exists ");
    So on solaris 10(korean) we have file named in korean language under "usr" directory. When i try to run the above program on solaris 10(Korean) using the default jre (1.5)with the parameter "/usr/file name in korean language" .The output of the program is "File Exists"
    And when i run the same class file using the jre (1.6) which is installed in our application which is an english version with the same parameter ""/usr/file name in korean language"
    The output of the program is "File does not exists".
    And this problem is only with the files which contain the name in korean language.
    So do we need to set any properties for the jre in our application to work for files which are named in korean language. Any help will be highly appreciated.
    Thanks,
    GPK
    Edited by: gpk_04 on Nov 11, 2008 1:46 PM
    Edited by: gpk_04 on Nov 11, 2008 1:57 PM

    My guess is that Java 5 and 6 are picking up the file system encoding differently. As a consequence, the JVM is either:
    1. reading and converting your command line argument incorrectly, or
    2. reading and converting the file name from the file system incorrectly.
    Write a quicky, short app that prints out the file encoding of your host. Run this under 5 and then 6. Do you see different outputs?

  • Do not continue until a file exists in powershell

    Hi,
    I was wondering if there is a method in powershell to get it to 
    continually check whether a file exists and do not progress until it finds it.
    i.e
    DO WHILE  
    c:\flag.txt NOT EXISTS
    Wait 10 seconds
    END
    <Next command >
    So that the <next Command> section is only executed once it finds the file c:\flag.txt
    Is this possible?
    Thanks,
    Zoe

    I doubt that it would have been very helpful anyway.  The requirement was
    "check whether a file exists and
    do not progress until it finds it"
    so blocking is exactly what's called for.  Putting it into a background job is probably just going to trade checking of the file status for checking on the job status.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    My post was very helpful, indeed.
    Blocking any instance of an application (PowerShell in this case) is almost always a very bad decision (*) because it blocks the UI.
    Do you understand that a UI, when blocked cannot process any other command from user, just because the UI is blocked?
    ( Alright, Ctrl+Break can stop the process, and the terminate the PowerShell session too! )
    Your argumentation is proper of a non-programmer.
    Imagine the situation: you, the user, has a powerful computer at your finger tips, with last generation of MS server, which is running your smart PS script that's blocking (how many hours for?) your PS instance. In this case, you don't need a powerful computer,
    what you need is a better PowerShell scripter.
    Haven't heard of Star-Job?
    Spend sometime reading about it, it's worth the reading.
    ( Alright, your mvp friend seems never heard of it, when I look at the crap code he did using Star-Job in another thread. )
    The solution is very simple: Start a job to wait for whatever have to be waited; then, keep using the PS instance
    normally, and check once or another if the job is completed (or use another sync mechanism).
    This is smart!
    Blocking the UI is since ever, not smart.
    (*) except very specific situations; fortunately, current computers are preemptively multitask.
    I understand it blocks the UI, but we don't have any indication in the question that this is going to be used in an interactive session or that the OP doesn't know about background jobs.  If it's going to have to monitor/wait for an extended period
    of time it could well be being implemented as a scheduled task or job, or even as a persistent job.  No matter what the session environment is, some solution for implementing that blocking behavior will be needed to satisfy the stated requirements, and
    the posted solution will do that.
    The assumption is that the OP isn't smart enough to figure out or experienced enough to know that what they're asking for will block their interactive session while it waits for the file.  I don't see anything in the question to warrant that assumption. 
    If it's going to have to wait an arbitrarily long time, a permanent registered event might be a better solution than the time loop.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Java.io.File exists() problem

    I have a web application deployed on a Windows 2000 server and am running Tomcat 4. I want to check for the existence of an image file before displaying it and am trying to use the java.io.File.exists() method. I am using the following code:
    String strPicUrl = "/images/thefile.jpg"; //Actual value comes from database
    File theFile = new File(application.getRealPath(strPicUrl));
    out.print("File Exists: " + theFile.exists() + "<br>");the actual file name in this example is "/images/theFile.jpg", and theFile.exists() always returns true if the file is there, but differs in case. If I try to display the image it doesnt show up under Tomcat because aliasing is turned off by default. I need to find a way to determine if a file exists based on actual case matching. This way if I get a "true" value, the file should be accessible and/or viewable via the JSP engine.
    Any ideas how to perform a case sensitive "exists()" regardless of the underlying OS file system?

    This looks awesome, but when I tried to implement it without creating a class, I get a method error. Here is the code below:
    String theDir = "C:\\Dir\\Subdir\\";
    FileFilter theFilter = new FileFilter() {
         private String _theFile = null;
         public boolean accept(File file)
              if (file.isDirectory()) return false;
              String fileName = file.getName();
              if (fileName.endsWith(_theFile)) return true;
              return false;
         public void setTheFile(String theFileParam)  
              _theFile = theFileParam;  
    theFilter.setTheFile("theFile.jpg");When I run this I get the following error:
    [javac] ...blah error stuff...
    [javac] cannot resolve symbol
    [javac] symbol : method setTheFile (java.lang.String)
    [javac] location: interface java.io.FileFilter
    [javac] theFilter.setTheFile("theFile.jpg");
    Since I am invoking the FileFilter object directly and not instantiating it in a class, is that causing the error or am I declaring "setTheFile()" wrong?

  • File.exists() takes too long to return.

    Hi.
    I have written a program which checks to see if a particular shared file is present on a number of different computers. The path to the file is the same on all the computers.
    I construct the File with IP + path.
    Then I call file.exists()
    If the remote computer is on and the file is present, then 'true' is returned quite quickly. But if the file is not available then 'false' is returned but only after about 30 seconds. This is too long and I want to set some sort of time out for the method after about 3 seconds. So that if the file is not found before the timeOut time, 'false' will be returned.
    Is there any way I can do this???
    Thanks,
    Jim

    Hi,
    I am already using Threads, here is my code:
    public class FileExistsThread extends Thread {
         private File file;
         private long tryTime;
         private boolean exists;
         private boolean changed;
         public FileExistsThread(File file, long tryTime) {
              this.file = file;
              this.tryTime = tryTime;
         public void run() {
              new Thread() {
                   public void run() {
                        try {
                             Thread.sleep(tryTime);
                        } catch(Exception e) {}
                        exists = false;
                        changed = true;
              }.start();
              exists = file.exists();
              changed = true;
         public boolean fileExists() {
              start();
              while(!changed);
              return exists;
    }The Problem is that I cant close my program while a file.exists() method is still executing no matter what Thread it is in. Say I'm looking for a file which the program will take 30 seconds to establish is not available. Then for that 30 seconds my program will refuse to close. Sometimes it can be much longer than this.
    This is why I still need some sort of timeout mechanism.
    Any Ideas?
    Cheers,
    Jim

  • File.exists() speed

    I have written a recursive algorithm for a particular statistical analysis that often requires in excess of 1x10^30 permutations. The function looks to see if file.exists(). If file.exists()==true, then a calculation is perfomed and a new file is written. If file.exists()==false, three "smaller" files are checked for using file.exists() by calling back on the same function. The function continues to divide the problem into smaller parts until it finds the files it needs. It then creates the files it doesn't currently have.
    When I run the function, it performs quickly when only a small number of recusions are required. Otherwise, the function gets very slow (the current run has been executing for 4 days now, and no it is not an infinite recusion). I don't know if the slowness is due to the number of objects that are created by the recusion (I create several thousand BigIntegers with each recusion), or if it is due to the file.exists() method. At the moment, several hundred files are stored in the directory where the file.exists() method is checking. If the slowness I'm encountering is due to the file.exists() method, and if that method is slowed by the number of files I have, is there a way to speed things up? For example, would it be faster to store all the file names in a file and then only search through this file for an existing file name?
    Another possibility for the slowness is that I'm also reading files at each recusion and the files may be 1-20MB each.
    Sorry I can't post any source code. I can't access my files at the moment.
    Any help or suggestions for speeding things up are greatly appreciated.
    Thanks,
    Patrick

    You should profile your code to see what it's actually doing all the time. Once you know what is slowing it down you can try to search for fixes.
    There are several profilers available for tuning Java:
    http://www.google.com/search?q=java+performance+profiler

  • False File.exists; flex cannot open SQLite.db file

    I have a program that uses an SQLite database. Instead of creating and importing the database, the sqlite databse already exists, with the data.
    I am trying to open it and read the information (select* from table - for example); But nothing i do seems to work.
    The error I am getting is: 'Error #3125: Unable to open the database file.', details:'Connection closed.', operation:'open', detailID:'1001'. I have checked the path repeatedly, The file exists. I run flash builder as administrator (win7).
    code:
    I have moved the database file all around. In the final version of the program, the database will be stored in a seperate drive on a network (Z:/database.db, for example) So i need to use the absolute path; although i have tried others (application storage directory, etc)
    var dbFile:File = new File("C:\Users\Public\Documents\graduates.db");
    trace('exists:' + dbFile.exists);
    //above being the important bit.
    dbStatement = new SQLStatement();
    dbStatement.itemClass = Grad;
    aluDB = new SQLConnection();
    dbStatement.sqlConnection = aluDB;
    aluDB.addEventListener(SQLEvent.OPEN, onDatabaseOpen);
    aluDB.addEventListener(SQLErrorEvent.ERROR, errorHandler);
    aluDB.open(dbFile);//error occurs here, of course.
    can anybody help me figure out why this error is occuring? Or even just a different method of opening the file?

    Hello,
    I have an Oracle Express Edition 10g running on
    Redhat Enterprise Linux 4 server.
    I have an Oracle database file which is 2.1 GB in
    size. I am not able to open this file using the
    application or the Oracle sql developer. The error
    message that I get is:
    ORA-01110: data file 5:
    '/usr/lib/oracle/xe/oradata/XE/service_3_0.dbf'
    ORA-27041: unable to open file
    Linux Error: 13: Permission denied
    I think this has to do with the fact that since it is
    not a 64-bit Linux but a 32-bit Linux, it does not
    support files larger than 2GB. What do you think I
    should do to tackle this problem?
    Best Regard
    ThayalanThat's interesting! I had no problems with opening files 32767MB in size on the very same 32 bit RH EL 4.0. How did you conclude that your file is too large, based on the error message which reads "Linux Error: 13: Permission denied"? Have you tried reading the manual page for the "open" system call and see when does it return EACCESS (error 13), found in /usr/include/asm-i386/errno.h. My man page for open says the following:
    ERRORS
    EACCES The requested access to the file is not allowed, or search per-
    mission is denied for one of the directories in the path prefix
    of pathname, or the file did not exist yet and write access to
    the parent directory is not allowed. (See also path_resolution(7).)
    What lead you to the conclusion that your file is too big? Do you have an access to a system administrator who knows how to use "strace"? If your system admin doesn't know how to use "strace", he too deserves waterboarding.

  • File.exists() is not accurate on smb2 network share (use WatchService?)

    Hi,
    According to this document: SMB2 Client Redirector Caches Explained File.exists() is not accurate on a smb2 network share. I am not able to change any register settings, so I want to deal with it. According to the document there is an API to get the notifications from the file system. I assumed that the WatchService is the Java implementation of this API. Am I correct?
    I started with the WatchDir example from the jdk samples and stripped it a bit. I only need to know when a file is created and delete (I don't care about file modifications). For testing I have added new File.exists() when a new event has been triggered. I also start a separated Thread which test the file existence also. When I don't start this separated thread the file exists returns true immediately. When the extra thread is started it is not accurate any more. I need a more accurate file.exists check in the whole application and all running threads.
    The output for my test case is this:
    FileExistsThread: subdir\test.txt == false
    watch registered for dir: subdir\
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    WatchDir event: ENTRY_CREATE: test.txt
    WatchDir: subdir\test.txt exists == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == false
    FileExistsThread: subdir\test.txt == true
    FileExistsThread: subdir\test.txt == true
    FileExistsThread: subdir\test.txt == true
    FileExistsThread: subdir\test.txt == true
    As you can see the file test.txt  is created on line 9. The FileExistsThread have seen it on line 20, (at least 10 x 300 ms later).
    For testing I have used 2 Windows 7 pc's (with smb2 enabled which is default). The working directory must be on the remote pc and the file test.txt must be created (or copied from another folder) on the remote pc (not using the network drive, but on the pc itself).
    Here is my test code:
    package nl.test.main;
    import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
    import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE;
    import static java.nio.file.StandardWatchEventKinds.OVERFLOW;
    import java.io.File;
    import java.io.IOException;
    import java.nio.file.ClosedWatchServiceException;
    import java.nio.file.FileSystems;
    import java.nio.file.Path;
    import java.nio.file.Paths;
    import java.nio.file.WatchEvent;
    import java.nio.file.WatchKey;
    import java.nio.file.WatchService;
    public class WatchDir
      private final WatchService _watcher;
      private final String _dir;
      public WatchDir( String dir ) throws IOException
        _dir = dir;
        _watcher = FileSystems.getDefault().newWatchService();
        Paths.get( dir ).register( _watcher, ENTRY_CREATE, ENTRY_DELETE );
        System.out.println( "watch registered for dir: " + dir );
      public void run()
        try
          while ( true )
            WatchKey key = _watcher.take();
            for ( WatchEvent<?> event : key.pollEvents() )
              WatchEvent.Kind<?> kind = event.kind();
              if ( kind == OVERFLOW )
                continue;
              @SuppressWarnings( "unchecked" )
              WatchEvent<Path> ev = (WatchEvent<Path>)event;
              Path fileName = ev.context();
              System.out.println( "WatchDir event: " + kind.name() + ": " + fileName );
              if ( kind == ENTRY_CREATE )
                String realPath = _dir + fileName;
                System.out.println( "WatchDir: " + realPath + " exists == " + new File( realPath ).exists() );
            key.reset();
        catch ( ClosedWatchServiceException x )
          return;
        catch ( InterruptedException ex )
          return;
      public static void main( String[] args )
        Thread t = new Thread( new Runnable()
          @Override
          public void run()
            try
              while ( true )
                String filename = "subdir\\test.txt";
                boolean fileExists = new File( filename ).exists();
                System.err.println( "FileExistsThread: " + filename + " == " + fileExists );
                Thread.sleep( 300 );
            catch ( InterruptedException e )
              e.printStackTrace();
              return;
        t.start();
        try
          new WatchDir( "subdir\\" ).run();
        catch ( IOException e )
          e.printStackTrace();
    Any idea's?
    Thanks,
    Olaf

    If you donot have access to note 45172.1 as specified by Laurent Schneider.
    Snippet from note
    a. Mapped Drive : To use a mapped drive, the user that the service starts as
    must have setup a drive to match UTL_FILE_DIR and be logged onto the server
    when UTL_FILE is in use.
    b. Universal Naming Convention : UNC is preferable to Mapped Drives because
    it does not require anyone to be logged on and UTL_FILE_DIR should be set to
    a name in the form :
    \\\<machine name>\<share name>\<path>
    or
    "\\<machine name>\<share name>\<path>"

Maybe you are looking for