Writing to external files

Is there any documentation in addition to the standard SDK documet?
I have to challenges:
1. What LUA code do i use inside a typical "grid" to write seomthing to an external file ?
2. How can I change settings for the stahdard image files. For example, I like to output the large files with a different JPEG compression than the thumbnails.

Probably a newbie question...
I tried the exampe from jarnoh above, but I get the error "Attempt to index local 'file' (a nil value).
This is my code:
local LrTasks = import 'LrTasks'
local LrApplication = import 'LrApplication'
local LrFunctionContext = import 'LrFunctionContext'
local LrProgressScope = import 'LrProgressScope'
local LrBinding = import "LrBinding"
local LrView = import "LrView"
local LrDialogs = import 'LrDialogs'
local LrPathUtils = import 'LrPathUtils'
local LrFileUtils = import 'LrFileUtils'
local LrStringUtils = import 'LrStringUtils'
local LrDate = import 'LrDate'
local catalog = import "LrApplication".activeCatalog()
function WriteExternalFile()
local file = io.open("example.txt", "w")
file:write("This is an test.")
file:close()
end
WriteExternalFile()

Similar Messages

  • Runtime.exec--problems writing to external file

    Hi. I went to http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html, and am still quite confused regarding the use of Runtime.exec, for my purposes. I want to decompile a CLASS file using javap, and then write that to a TXT file, for easier reading/input to JAVA. Now, I use the following code (a modification of what I got from http://www.mountainstorm.com/publications/javazine.html, as the "traps" article's sample code is WAY too confusing--they say the compiler had the output sent to text.txt, without even showing how in the source code they did that), but it hangs up. Modifications to the string array cause different results, such as showing the javap help menu, or saying that the class wasn't found, but I think the way I did the array here is right:
    import java.util.*;
    import java.io.*;
    public class Test {
            try {
             String ls_str;
                String[] cmd = {"C:\\j2sdk1.4.2_04\\bin\\javap", "-c", "-classpath", "H:\\Java\\metricTest", "metricTest > blah.txt", ""};
                Process ls_proc = Runtime.getRuntime().exec(cmd);
             // get its output (your input) stream
             DataInputStream ls_in = new DataInputStream(
                                              ls_proc.getInputStream());
             try {
              while ((ls_str = ls_in.readLine()) != null) {
                  System.out.println(ls_str);
             } catch (IOException e) {
              System.exit(0);
         } catch (IOException e1) {
             System.err.println(e1);
             System.exit(1);
         System.exit(0);
    }

    Also, jesie, I realize that's what I need...the only
    problem is, the name "test.txt" is nowhere to be found
    in the source code! lolLooks like I have to explain this, then.
    When you look at a Java program you'll notice that it always has a "main" method whose signature looks like this:public static void main(String[] args)When you execute that program from the command line, it takes whatever strings you put after the class name and passes them to the main program as that array of strings. For example if you run it likejava UselessProgram foo bar hippothen the "java" command takes the three strings "foo", "bar", and "hippo" and puts them into that args[] array before calling the "main" method.
    That means that inside the "main" method in this case, "args[0]" contains "foo", "args[1]" contains "bar", and "args[2]" contains "hippo".
    Now go back to the example and see how it lines up with that.

  • Reading the Blob and writing it to an external file in an xml tree format

    Hi,
    We have a table by name clarity_response_log and content of the column(Response_file) is BLOB and we have xml file or xml content in that column. Most probably the column or table may be having more than 5 records and hence we need to read the corresponding blob content and write to an external file.
    CREATE TABLE CLARITY_RESPONSE_LOG
      REQUEST_CODE   NUMBER,
      RESPONSE_FILE  BLOB,
      DATE_CRATED    DATE                           NOT NULL,
      CREATED_BY     NUMBER                         NOT NULL,
      UPDATED_BY     NUMBER                         DEFAULT 1,
      DATE_UPDATED   VARCHAR2(20 BYTE)              DEFAULT SYSDATE
    )The xml content in the insert statement is very small because of some reason and cannot be made public and indeed we have a very big xml file stored in the BLOB column or Response_File column
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (5, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (6, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (7, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (8, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (9, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');THe corresponding proc for reading the data and writing the data to an external file goes something like this
    SET serveroutput ON
    DECLARE
       vstart     NUMBER             := 1;
       bytelen    NUMBER             := 32000;
       len        NUMBER;
       my_vr      RAW (32000);
       x          NUMBER;
       l_output   UTL_FILE.FILE_TYPE;
    BEGIN
    -- define output directory
       l_output :=
          UTL_FILE.FOPEN ('CWFSTORE_RESPONCE_XML', 'extract500.txt', 'wb', 32760);
       vstart := 1;
       bytelen := 32000;
    ---get the Blob locator
       FOR rec IN (SELECT response_file vblob
                     FROM clarity_response_log
                    WHERE TRUNC (date_crated) = TRUNC (SYSDATE - 1))
       LOOP
    --get length of the blob
    len := DBMS_LOB.getlength (rec.vblob);
          DBMS_OUTPUT.PUT_LINE (len);
          x := len;
    ---- If small enough for a single write
    IF len < 32760
          THEN
             UTL_FILE.put_raw (l_output, rec.vblob);
             UTL_FILE.FFLUSH (l_output);
          ELSE  
    -------- write in pieces
             vstart := 1;
             WHILE vstart < len AND bytelen > 0
             LOOP
                DBMS_LOB.READ (rec.vblob, bytelen, vstart, my_vr);
                UTL_FILE.put_raw (l_output, my_vr);
                UTL_FILE.FFLUSH (l_output);
    ---------------- set the start position for the next cut
                vstart := vstart + bytelen;
    ---------- set the end position if less than 32000 bytes
                x := x - bytelen;
                IF x < 32000
                THEN
                   bytelen := x;
                END IF;
                UTL_FILE.NEW_LINE (l_output);
             END LOOP;
    ----------------- --- UTL_FILE.NEW_LINE(l_output);
          END IF;
       END LOOP;
       UTL_FILE.FCLOSE (l_output);
    END;The above code works well and all the records or xml contents are being written simultaneously adjacent to each other but we each records must be written to a new line or there must be a line gap or a blank line between any two records
    the code which I get is as follow all all xml data comes on a single line
    <?xml version="1.0" encoding="ISO-8859-1"?><emp><empno>7369</empno><ename>James</ename><job>Manager</job><salary>1000</salary></emp><?xml version="1.0" encoding="ISO-8859-1"?><emp><empno>7370</empno><ename>charles</ename><job>President</job><salary>500</salary></emp>But the code written to an external file has to be something like this.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <emp>
      <empno>7369</empno>
      <ename>James</ename>
      <job>Manager</job>
      <salary>1000</salary>
    </emp>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <emp>
    <empno>7370</empno>
    <ename>charles</ename>
    <job>President</job>
    <salary>500</salary>
    </emp>Please advice

    What was wrong with the previous answers given on your other thread:
    Export Blob data to text file(-29285-ORA-29285: file write error)
    If there's a continuing issue, stay with the same thread, don't just ask the same question again and again, it's really Pi**es people off and causes confusion as not everyone will be familiar with what answers you've already had. You're just wasting people's time by doing that.
    As already mentioned before, convert your BLOB to a CLOB and then to XMLTYPE where it can be treated as XML and written out to file in a variety of ways including the way I showed you on the other thread.
    You really seem to be struggling to get the worst possible way to work.

  • Writing agents o/p to external file and if i run the agent again it should

    Hi All,
    i want to run a agent and that result should be displayed in external file system.and i achieved this by using writing VB script and in agents i used actions in that we have invoke server script.And i got the perfect output but what 's my scenario is when i run the agnent again it should create another file with below requirements.
    The file name must contain a suffix containing the date in yyyymmdd format. In cases where the file stored more than once per day, a sequence number must also be provided within the filename.
    (i.e. v1_yyyymmdd, v2_yyyymmdd, v3_yyyymmdd, v4_yyyymmdd, v5_yyyymmdd…)
    And my VB script is like below
    '#####=========================================================================
    '## Title: Export Report
    '## Rev: 1.0
    '## Author: Paul McGarrick
    '## Company: Total Business Intelligence / http://total-bi.com
    '## Purpose:
    '## 1. This script takes a file from OBIEE and saves to the file system
    '## 2. Creates a reporting subdirectory if not already present
    '## 3. Creates a further subdirectory with name based on current date
    '## Inputs (specified in Actions tab of OBIEE Delivers Agent):
    '## 1. Parameter(0) - This actual file to be exported
    '## 2. Parameter(1) - The filename specified within OBIEE
    '## 3. Parameter(2) - Report sub directory name specified within OBIEE
    '#####=========================================================================
    Dim sBasePath
    sBasePath = "E:\reports\reports"
    Dim sMasterPath
    sMasterPath = sBasePath & "\" & Parameter(2)
    Dim objFSO
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    'check whether master directory exists, if not create
    Dim objMasterDir
    If Not objFSO.FolderExists(sMasterPath) Then
         Set objMasterDir = objFSO.CreateFolder(sMasterPath)
    End If
    Set objMasterDir = Nothing
    'build string to get date in yyyy-mm-dd format
    Dim sDate, sDateFull
    sDate = Now
    sDateFull = DatePart("yyyy", sDate) & "-"
    If Len(DatePart("m", sDate))=1 Then sDateFull = sDateFull & "0" End If
    sDateFull = sDateFull & DatePart("m", sDate) & "-"
    If Len(DatePart("d", sDate))=1 Then sDateFull = sDateFull & "0" End If
    sDateFull = sDateFull & DatePart("d", sDate)
    Dim sDir
    sDir = sMasterPath & "\" & sDateFull
    Dim objDir
    If Not objFSO.FolderExists(sDir) Then
         Set objDir = objFSO.CreateFolder(sDir)
    End If
    Set objDir = Nothing
    Dim sFileName
    sFileName = sDir & "\" & Parameter(1)
    Dim objFile
    objFSO.CopyFile Parameter(0), sFileName, True
    Set objFile = Nothing
    Set objFSO = Nothing
    could you please any body help me out from this....

    I assume you are using Windows. Try to write a batch file so that that would look for the ibot name when ever its finds rename the file name as required.
    This would be easiest way..
    http://lmgtfy.com/?q=rename+a+file+to+current+date+using+batch+file
    Edited by: Srini VEERAVALLI on Apr 8, 2013 7:23 AM
    Can you updates all your posts?
    Edited by: Srini VEERAVALLI on May 13, 2013 6:44 AM

  • Problem writing external file to externally mounted disk in Windows

    Folks,
    I've got a puzzling problem with a simple OWB mapping where I'm dumping the contents of a table to an external file.
    Versions are OWB v 11.2.0.2 64-bits on Oracle RDBMS 11.2.0.2 Windows 2007 64-bits Enterprise Server.
    When the external files module is hooked up to a location that points to a local disk and directory on the OWB-server, everything works fine - files are created and written.
    When the external files module is hooked up to a location that points to a mounted disk on another Windows 2007 64-bits Enterprise Server, I get +"Invalid Path for target file, check if connector is deployed correctly".+
    The "File System Location Path" in OWB is set to "N:" (no slashes either way). "Test Connection" reports OK.
    I've given both the Oracle os-user and "Everyone" (for good measure) all rights on the mounted disk, and I can see that the generated package code is using the correct Directory, and the Directory Path is the correct one on the server. The mounted disk (N:) should appear as a local disk to Oracle as far as I can see. I'm able to create and delete files on the disk using command line on the OWB/DB-server.
    I'm scratching my head on this one....

    then mapped that share as a network drive (N:) on server A (the OWB/DB-server)I think that problem was with different accounts used for run Oracle database (usually database instance run under SYSTEM account) and which you used to map share (it was interactive session). Even when you made this map persistent (enable "Reconnect at logon" option during mapping) you don't grant access to this drive to other accounts (including SYSTEM ) - this drive will not be visible to other users.
    I think it is possible to create "persistent" network drive mapping for Oracle database context with specification non-SYSTEM account (domain or server local) for running Oracle database instance (and Oracle Listener service).
    Also it seems there is a workaround to access mapped network drive under SYSTEM account:
    http://stackoverflow.com/questions/182750/how-to-map-a-network-drive-to-be-used-by-a-service
    Regards,
    Oleg

  • Writing code or text in an external file

    i want to write some text or code in an external file such as
    (text file or something else)
    when an event in flash occurs
    like (on mouse click)
    thanks for your answer

    Its important to know whether its plain text or code that
    you're expecting to execute. You can use something like the
    loadVars method to read a plain text or XML file. You could get
    variables from it to use in your code. But the movie will have been
    compiled already, so I don't think large blocks of code are
    appropriate here. That having been said, you can create external AS
    files that are compiled into your SWF.
    Hope that helps!

  • External file writing woes!

    so i have my code that reads from an external file brilliantly, but then the problems tart when i try to write to the file.
    option 2 on the menu works fully, and doesadd data to the file, but itis not adding it to the end of the records like it should. instead it is adding it after the first record, then shifting the surnames ofthe records below it.
    import java.util.*;
    import java.io.PrintStream;
    import java.io.File;
    import java.io.FileNotFoundException;
    public class contacts
        private static final int MAX_RECORDS = 20;
        private static String lastName[] = new String[MAX_RECORDS];
        private static String firstName[] = new String[MAX_RECORDS];
        private static String telNumber[] = new String[MAX_RECORDS];
        private static String emailAddress[] = new String[MAX_RECORDS];
        private static Scanner data_input = new Scanner(System.in);
        public static int read_in_file(String file_name)
            Scanner read_in;
            Scanner line;
            int record_count = 0;
            String record;
            try
                read_in = new Scanner(new File(file_name));
                // read in one line at a time
                read_in.useDelimiter(System.getProperty("line.separator"));
                while (read_in.hasNext())
                    // Test to see if there are too many records in the file
                    if (record_count == MAX_RECORDS)
                        System.out.printf("Only %d records allowed in file", MAX_RECORDS);
                        System.exit(0);
                    // read in record
                    record = new String(read_in.next());
                    // Split the record up into its fields and store in
                    // appropriate arrays
                    line = new Scanner(record);
                    line.useDelimiter("\\s*,,\\s*");
                    lastName[record_count] = line.next();
                    firstName[record_count] = line.next();
                    telNumber[record_count] = line.next();
                    emailAddress[record_count] = line.next();
                    // Increment record count
                    record_count++;
            catch (FileNotFoundException e)
                e.printStackTrace();
            return record_count;
        public static void write_out_file(int no_of_records, String filename)
            PrintStream write_out;
            int counter;
            try
                // Create new file
                write_out = new PrintStream(new File(filename));
                // Output all reacords
                for(counter = 0; counter < no_of_records; counter++)
                    // Output a record
                    write_out.print(lastName[counter]);
                    write_out.print(",,");
                    write_out.print(firstName[counter]);
                    write_out.print(",,");
                    write_out.print(telNumber[counter]);
                    write_out.print(",,");
                    write_out.println(emailAddress[counter]);
                // Close file
                write_out.close();
            catch (FileNotFoundException e)
                e.printStackTrace();
        // Your 'Methods' go here
        public static void display_all()
              for (int d = 0; d < 20; d++)
                        if (lastName[d] != null)
                             System.out.printf("%n%s%n",      lastName[d]          );
                             System.out.printf("%s%n",      firstName[d]          );
                             System.out.printf("%s%n",      telNumber[d]          );
                             System.out.printf("%s%n",      emailAddress[d]          );
        public static void main(String[] args)
            // Declare Variables
            int user_choice;
            boolean quit = false;
            Scanner dataInput = new Scanner(System.in);
            int number_of_records, records, n, sort;
            String filename, first_name, last_name, enter, tel_num, email_addr;
            // Get filename and read in file
            System.out.print("Enter the masterfile file name: ");
            filename = data_input.next();
            number_of_records = read_in_file(filename);
            // Your 'main' code goes here
            //display menu
            do
            System.out.printf("%n%nMenu%n%n");
            System.out.println("1. Search records (use * to list all)");
            System.out.println("2. Insert record");
            System.out.println("3. Delete record");
            System.out.println("4. Quit with saving");
            System.out.println("5. Quit without saving");
            //get users choice
            user_choice = data_input.nextInt();
            //process choice
            switch(user_choice)
                case 1:
                             System.out.print("Please Enter Last Name: ");
                             last_name = dataInput.next();
                             System.out.print("Do You with to Enter First Name? (Y/N): ");
                             enter = dataInput.next();
                             if (enter.equalsIgnoreCase("N"))
                                  for (int i = 0; i < number_of_records; i++)
                                       if (last_name.compareTo(lastName) == 0)
                                            //Arrays.sort(lastName[i]);
                                            System.out.printf("%n%s%n",      lastName[i]          );
                                            System.out.printf("%s%n",      firstName[i]          );
                                            System.out.printf("%s%n",      telNumber[i]          );
                                            System.out.printf("%s%n",      emailAddress[i]          );
                             if (enter.equalsIgnoreCase("Y"))
                                  System.out.print("Please Enter First Name: ");
                                  first_name = dataInput.next();
                                  for (int i = 0; i < number_of_records; i++)
                                       if ((last_name.compareTo(lastName[i]) == 0) && (first_name.compareTo(firstName[i]) == 0))
                                            System.out.printf("%n%s%n",      lastName[i]          );
                                            System.out.printf("%s%n",      firstName[i]          );
                                            System.out.printf("%s%n",      telNumber[i]          );
                                            System.out.printf("%s%n",      emailAddress[i]          );
                             if (last_name.compareTo("*") == 0)
                                  for (int i = 0; i < number_of_records; i++)
                                       //There cannot be more then a 20 data records in the file
                                       if (lastName[i] != last_name)
                                            System.out.printf("%n%s%n",      lastName[i]          );
                                            System.out.printf("%s%n",      firstName[i]          );
                                            System.out.printf("%s%n",      telNumber[i]          );
                                            System.out.printf("%s%n",      emailAddress[i]          );
    break;
    case 2:
    System.out.print("Please enter the last name of the contact: ");
    last_name = dataInput.next();
    System.out.print("Please enter the first name of the contact: ");
    first_name = dataInput.next();
    System.out.print("Please enter the telephone number of the contact: ");
    tel_num = dataInput.next();
    System.out.print("Please enter the email address of the contact: ");
    email_addr = dataInput.next();
    int z = 0;
    for (int i=0; i < number_of_records; i++)
    if ((last_name.compareTo(lastName[i])) < i && (last_name.compareTo(lastName[i]) > i))
    z = i;
    for (int i = number_of_records; i > z; i--)
    lastName[i] = lastName[i-1];
    lastName[z+1] = last_name;
    firstName[z+1] = first_name;
    telNumber[z+1] = tel_num;
    emailAddress[z+1] = email_addr;
    break;
    case 3:
                             System.out.print("Please enter the last name of the contact: ");
                             last_name = dataInput.next();
                             int z = 0;
                             for (int i=0; i < number_of_records; i++)
                                  if ((last_name.compareTo(lastName[i])) < i && (last_name.compareTo(lastName[i]) > i))
                                       z = i;
                             for (int i = z; i < number_of_records; i++)
                                  lastName[i] = lastName[i+1];
                             //lastName[z-1] = lastName[i];
                             //firstName[z-1] = firstName[i];
                             //telNumber[z-1] = telNumber[i];
                             //emailAddress[z-1] = emailAddress[i];
                             // Get new filename and write out the file
                             System.out.print("Please Enter New Masterfile File Name: ");
                             filename = dataInput.next();
                             write_out_file(number_of_records, filename);
                             System.out.print("File Save In Progress. Please Wait...");
                             for (int r = 0; r < 35000000; ++ r) System.currentTimeMillis ();
                                  System.out.print("..");
                             for (int r = 1000000; r < 10000000; ++ r) System.currentTimeMillis ();
                                  System.out.print("............");
                             System.out.printf("%nGoodbye!");
    break;
    case 4:
                             // Get new filename and write out the file
                             System.out.print("Please Enter New Masterfile File Name: ");
                             filename = dataInput.next();
                             write_out_file(number_of_records, filename);
                             System.out.print("File Save In Progress. Please Wait...");
                             for (int r = 0; r < 35000000; ++ r) System.currentTimeMillis ();
                                  System.out.print("..");
                             for (int r = 1000000; r < 10000000; ++ r) System.currentTimeMillis ();
                                  System.out.print("............");
                             System.out.printf("%nGoodbye!");
    break;
    case 5:
    quit = true;
    break;
    default:
    System.out.println("Invalid menu choice, please try again");
    } while(!quit);
    any insight as to what the problem is, and how to fix it?
    thanks in advance

    for now im just looking for the solution to the
    problem i stated. after i have the code working, i
    will work on tidying it up.No. You are still not understanding something very fundamental here.
    The code is bad design. It will be diificult to make work BECAUSE it is
    a bad design. A better OO based approach would result in code that is
    cleaner and easier to make work.
    Nobody in their right mind is going to "help you" (aka rewrite entirely)
    somebody else's terrible design. What is the point of that? None. The
    fastest way for you to get code that is working is to start with better
    thought out code. You can read the thread you copied this code from to
    get some ideas of why this code is bad.
    Or you can start with some tutorials.
    Nobody cares if this is for school, work, fun, whatever. You need to do
    your thinking on your own. If you are incapable of putting the effort in
    then you need to reconsider your options. Perhaps paying somebody
    to write code for you is a better solution.

  • How to test if an external file is already opened?

    We have an issue when we write to an external file via the DBOpen and DBAdd functions. When we run two jobs simultaneously, they write to the same file. I know we can write to separate files, but we rather not. When the second job begins to do the write, at that point of entry for the second job, that record gets corrupted.
    I'm not sure if it is a DBOpen issue, or DBAdd issue, so I was wanting to try a test to see if the file is already open and bypass the DBOpen if it is. But I don't see anything that will test that other than the DBOpen function itself. When I capture the return code, the result is successful for both jobs. But I"m not wanting to do another DBOpen if the file is already open.
    How do I test for that?

    In the DBOpen call specification, there is a mode parameter which supports combinations of the following:
    * READ
    * WRITE
    * CREATE_IF_NEW
    * FAIL_IF_EXISTS
    You can combine multiple modes with &, so the 2 ^nd^ job should use DBOpen(table,handler,dfd,"WRITE&FAIL_IF_EXISTS") and you can examine the return code accordingly (1 = success, 0 = fail). That said, I don't think this is going to work. If you want to have multiple processes writing to a single file you're probably better off writing the records to a database table which supports this sort of activity. Otherwise you might consider having each job writing to a separate temp file, and then one of the jobs be responsible for reading both temporary files and writing out a 3 ^rd^ file containing all records.
    -Andy

  • Load external files

    I created fifteen 300 X 250 sized movieclips. I've adjusted each movieclip into different sizes. Now I need to load 15 external files in to these movieclips. (all external files are 300 X 250).
    1. When I load the external files, all the loaded files does not adjust to the resized movieclips (all external files are maintaining it original size). I need the loaded files to be resized as per the movieclips on stage.
    2. Is there a short way of writing the code to load these 15 external files?
    //movieclips on stage: gHolderF0, gHolderF1, gHolderF2
    //external files : sample0.swf, sample1.swf, sample2.swf
    I'm using this to load each external file:
    var loaderPrototype:Loader = new Loader();
    var selectedPrototype:URLRequest=new URLRequest("sample/sample0.swf");
    loaderPrototype.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading);
    loaderPrototype.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
    loaderPrototype.load(selectedPrototype);
    function finishLoading(loadEvent:Event) {
    gHolderF0.addChild(loadEvent.currentTarget.content);
    addChild(gHolderF0);
    function errorHandler(errorEvent:Event):void {
    trace("file missing");
    function errorHandler(errorEvent:Event):void {
    trace("file missing");

    adding a child (loader or otherwise) is going to affect the scale of the child and the position of the child.  but you can't assign the exact size unless you do some intelligent scaling of the parent.  for example:
    after loading is complete:
    gHolderF0.scaleX=300*loaderPrototype.width;  // resize to 300x250
    gHolderF0.scaleY=250*loaderPrototype.height;
    but that really makes no sense.  you may as well resize the loader directly:
    loaderPrototype.width=300
    loaderPrototype.height=250;

  • Creating external files (.txt, .json, etc)

    Hello everyone,
    I'm currently trying to find out how to create external files from a SWF/exe/app file created in Flash. Essentially I'm building a program to create templates for levels in a game. The SWF will be run locally (e.g. not online) and will allow the user to add/remove objects to a level of their design. They then need to be able to save the level template (ideally I need to be able to save as a JSON* file, but I'm sure I could get away with just a simple txt file) somewhere on their computer. These templates will them be imported by the game itself (not written in Flash, hence why I need to save the data as a json or txt file), which will then re-create the levels from the data contained in the save file.
    I had assumed this would be something that was really simple to do, but I cannot seem to find any tutorials or information on how to create external files. I can find plenty on reading from existing external files, but nothing about actually writing a new file entirely. I have read a few people complaining that non-local Flash SWFs cannot access the user's hard drive for security reasons, but cannot find any information on local SWFs.
    If anyone could tell me even roughly what I'm looking for, it would be greatly appreciated. I'm a bit stuck just now haha
    *I have downloaded the corelib files which allow me to work with JSON files

    Flash is not able to write any type of text file on user system.
    U have to use air or zinc to intract with file system.
    Yes u can use shared objects also. Which stores value to user computer and browser stores cookies on user system

  • "void" value in Data Sets external file?

    Hi I'm trying to achieve what I thought it was a simple thing (and turned out not to be so):
    I'm importing a set of variables and values from an external file via menu Import/Dataset/Apply...
    Occasionally, I'd like not to return any value from an specific field, an let it as is (with it's current value/content in the photoshop layer).
    I tried setting the empty separator,void and null with no success.
    Example:
    (file.txt):
    mytext1,mytext2,logo,backgroundimage (fields)
    dude,sometext,void,myimage.jpg (values)
    also tried:
    mytext1,mytext2,logo,backgroundimage
    dude,sometext,,myimage.jpg
    and finally:
    mytext1,mytext2,logo,backgroundimage
    dude,sometext,null,myimage.jpg
    With null, void or ,, I'm trying that photoshop ignores this field and takes it's current layer value.
    Is this possible?
    thanks in advance

    I think that with scripting you could get close to useing null/blank values.
    The script would have to read the original dataset text file one line at a time and create a new dataset text file to import then apply. If it found a null or undefined value it would replace that value with the current value before writing the new file. I think that it would only work with text and visibility. I not sure how it could handle image replacement.
    Here are some functions you will need.
    fileImportDataSets = function( file ) {
        var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putClass( stringIDToTypeID( "dataSetClass" ) );
        desc.putReference( charIDToTypeID( "null" ), ref );
        desc.putPath( charIDToTypeID( "Usng" ), new File( file ) );
        desc.putEnumerated( charIDToTypeID( "Encd" ), stringIDToTypeID( "dataSetEncoding" ), stringIDToTypeID( "dataSetEncodingAuto" ) );
        desc.putBoolean( stringIDToTypeID( "eraseAll" ), true );
        desc.putBoolean( stringIDToTypeID( "useFirstColumn" ), true );
    executeAction( stringIDToTypeID( "importDataSets" ), desc, DialogModes.NO );
    function applyDataSet(setName);{
        var desc = new ActionDescriptor();
            var setRef = new ActionReference();
            setRef.putName( stringIDToTypeID( "dataSetClass" ), setName );
        desc.putReference( charIDToTypeID( "null" ), setRef );
    executeAction( charIDToTypeID( "Aply" ), desc, DialogModes.NO );

  • How to write or send String to an external file in java

    Hi guys...!
    I am writing a program in which I have to send some texts to an external file. If the file is not empty, I want the program to append to that file instead of overwriting the file.
    Any suggestions...guys??
    Thanks...
    --- Spirit_Away

    Hi therer...!
    Thanks for your suggestion... But I forgot to mention
    that I'm using XML in my java program and the method
    "endElement()" for XML throws a "SAXException" and it
    would not let me add another exception next to it
    ...like the one thrown by the "FileWriter", which is
    IOException...
    Thanks....
    --- Spirit_AwayIn that case you might be too stupid to be programming Java.

  • JSON external file

    I'm having trouble with this script. can anyone help me? I thought JSON was built into edge. but after writing these lines of code it doesn't appear so....
    var imageArray = new Array();
    var currentImage = 0;
    var mySlidingImages = sym.getSymbol("ImageSlider");
    sym.$("PlaceHolderText").html("");
    $.getJSON("data/photos.json", function(data){
                   for(var i=0; i<data.length; i++){
                                  imageArray.push({"image":data[i].image,"title":data[i].title});
                   sym.$("PlaceHolderText").html(imageArray[currentImage].title);
    so when that didn't work I tried this:
    yepnope({
    nope:[
    'edge_includes/json2_min.js'
    complete: init
    //when yepnope has loaded everything execute init();
    function init (){
    //initialise your variables and Edge comp here
    var imageArray = new Array();
    var currentImage = 0;
    var mySlidingImages = sym.getSymbol("ImageSlider");
    sym.$("PlaceHolderText").html("");
    $.getJSON("data/photos.json", function(data){
              for(var i=0; i<data.length; i++){
                        imageArray.push({"image":data[i].image,"title":data[i].title});
              sym.$("PlaceHolderText").html(imageArray[currentImage].title);
    Basically what I'm trying to do is create a slider that will auto populate, with image and text, according to an external file "photos.json".  But I'm a noob at coding so I don't know what my mistake is... if anyone could help me understand what I'm doing wrong i would appreciate it.. ty..

    About the first image: you've got a wrong line inside $.getJSON:
    $.getJSON("data/photos.json", function(data){
             maxImages = data.length-1;
              for(var i=0; i<data.length; i++){ imageArray.push({"image":data[i].image,"title":data[i].title}); }
              sym.$("PlaceHolderText").html(imageArray[currentImage].title);
              mySlidingImages.$("ImageHolder1").css({"background-image":"url('"+imageArray[currentImage ].image+"')"});
              mySlidingImages.play("Rest"); // the wrong line
              mySlidingImages.play(); // a better slideIn effect.

  • How to open and read an external file in Dashboard widget?

    I am new to Dashboard widgets and also Javascript. I have written a widget that needs to open and read a file on the local file system. I have searched a lot and have not found any documentation or reference on the internet as to how to do this.
    I know it can be done since there is a checkbox in the widget attributes that says "Allow External File Access".
    can anyone help me out here?
    Thanks

    You need to define the AllowFileAccessOutsideOfWidget key to Yes.
    You also need to define the AllowFullAccess key.
    You may also need to define the AllowSystem key (to Yes of course).
    Mihalis.
    PS. If you cannot find any other documentation please check http://widgetbook.blogspot.com.

  • External table: How to load data from a fixed format UTF8 external file

    Hi Experts,
    I am trying to read data from a fixed format UTF8 external file in to a external table. The file has non-ascii characters, and the presence of the non-ascii characters causes the data to be positioned incorrectly in the external table.
    The following is the content's of the file:
    20100423094529000000I1 ABÄCDE 1 000004
    20100423094529000000I2 OMS Crew 2 2 000004
    20100423094529000000I3 OMS Crew 3 3 000004
    20100423094529000000I4 OMS Crew 4 4 000004
    20100423094529000000I5 OMS Crew 5 5 000004
    20100423094529000000I6 OMS Crew 6 6 000004
    20100423094529000000I7 Mobile Crew 7 7 000004
    20100423094529000000I8 Mobile Crew 8 8 000004
    The structure of the data is as follows:
    Name Type Start End Length
    UPDATE_DTTM CHAR 1 20 20
    CHANGE_TYPE_CD CHAR 21 21 1
    CREW_CD CHAR 22 37 16
    CREW_DESCR CHAR 38 97 60
    CREW_ID CHAR 98 113 16
    UDF1_CD CHAR 114 143 30
    UDF1_DESCR CHAR 144 203 60
    UDF2_CD CHAR 204 233 30
    DATA_SOURCE_IND CHAR 294 299 6
    UDF2_DESCR CHAR 234 293 60
    I create the external table as follows:
    CREATE TABLE "D_CREW_EXT"
    "UPDATE_DTTM" CHAR(20 BYTE),
    "CHANGE_TYPE_CD" CHAR(1 BYTE),
    "CREW_CD" CHAR(16 BYTE),
    "CREW_DESCR" CHAR(60 BYTE),
    "CREW_ID" CHAR(16 BYTE),
    "UDF1_CD" CHAR(30 BYTE),
    "UDF1_DESCR" CHAR(60 BYTE),
    "UDF2_CD" CHAR(30 BYTE),
    "DATA_SOURCE_IND" CHAR(6 BYTE),
    "UDF2_DESCR" CHAR(60 BYTE)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "TMP"
    ACCESS PARAMETERS ( RECORDS DELIMITED BY NEWLINE
    CHARACTERSET UTF8
    STRING SIZES ARE IN BYTES
    NOBADFILE NODISCARDFILE NOLOGFILE FIELDS NOTRIM
    ( "UPDATE_DTTM" POSITION (1:20) CHAR(20),
    "CHANGE_TYPE_CD" POSITION (21:21) CHAR(1),
    "CREW_CD" POSITION (22:37) CHAR(16),
    "CREW_DESCR" POSITION (38:97) CHAR(60),
    "CREW_ID" POSITION (98:113) CHAR(16),
    "UDF1_CD" POSITION (114:143) CHAR(30),
    "UDF1_DESCR" POSITION (144:203) CHAR(60),
    "UDF2_CD" POSITION (204:233) CHAR(30),
    "DATA_SOURCE_IND" POSITION (294:299) CHAR(6),
    "UDF2_DESCR" POSITION (234:293) CHAR(60) )
    ) LOCATION ( 'D_CREW_EXT.DAT' )
    REJECT LIMIT UNLIMITED;
    Check the result in database:
    select * from D_CREW_EXT;
    I found the first row is incorrect. For each non-ascii character,the fields to the right of the non-ascii character are off by 1 character,meaning that the data is moved 1 character to the right.
    Then I tried to use the option STRING SIZES ARE IN CHARACTERS instead of STRING SIZES ARE IN BYTES, it doesn't work either.
    The database version is 11.1.0.6.
    Edited by: yuan on May 21, 2010 2:43 AM

    Hi,
    I changed the BYTE in the create table part to CHAR, it still doesn't work. The result is the same. I think the problem is in ACCESS PARAMETERS.
    Any other suggestion?

Maybe you are looking for

  • How to play youtube on nokia xl

    I can not access Youtube as it dislay a msg from google play that this device does not support. Plz if anyone can help.

  • Can PCM multi-channel wav (not DD or DTS) be sent over SPDIF

    <Can PCM multi-channel wav (not DD or DTS) be sent over SPDIF? --- X-Fi Elite Pro SB055A and Audio Creation Mode --- If I understand correctly, SPDIF format can support uncompressed MULTICHANNEL wav format (within the limitations of its bandwidth) as

  • We stop at  START_SHDI_FIRST

    hi experts, we are stoped at this phase.shadow instace is not sttarting below is the DEVELOPERTRACE.LOG trc file: "dev_disp", trc level: 1, release: "640" Thu Mar 27 04:43:40 2008 System memory affinity level found as 0, no support requested in SAP i

  • Ringtone not authorized

    I recently purchased a ringtone from itunes on my phone but when i synced my phone it told me that the computer wasn't authorized to play it. The ringtone appears in the ringtone section and in the purchased on iphone section but is now gone from my

  • Help in Website

    Hello frnds, I want to create website. I want to know what r the standards for website creation. THANKS ANAND