How do I populate an array with a directory listing.

I have a web site that has its photos updated by another person using a content management system that I have written. As Dreamweaver does not know about these extra photos, if I try to
syncronise the site on my machine for backup purposes, Dreamweaver downloads all 5000+ photos, and this can take upwards of 12 hours if there are no breaks in the connection.
So I am trying to write a page that creates an array of the existing files on the remote site. It will then do the same on my local site, and by comparing the arrays, will make a list of the new files, and then download these, which will save a lot of time and bandwith charges.
First I have to read the directory list, using the code below which reads and echos it on screen.
However, I cannot work out how to populate the required array.
<?php
    try
    {          /***photo directory ***/
        $it = new directoryIterator('../web/thumbs');
        while( $it->valid())
              /*** echo if not a dot directory ***/
            if( !$it->isDot() )
/**** Array creation code needs to go here I think.***/
echo $it->current()."<br />";
     /*** move to the next element ***/
                  $it->next();
    catch(Exception $e)
        /*** echo the error message ***/
        echo $e->getMessage();
?>
This creates a list of files and displays it on the page.
How do I store it in an array?
Howard Walker

Although not the solution you were looking for, consider the following:
Click the icon in DW for "Expand to show local and remote sites."  Arrange the remote image directory by "Modified date," Then select all the recent images and GET them.
I find the above method good enough for occassional synchronization. I also simply ignore broken image links on the testing system.
If the above is not a solid enough solution, perhaps someone else will write your array function for you. I don't have the time.

Similar Messages

  • How to populate an array with random text files.

    I am making a Jeopardy program. I have my program set up so that it retrieves 5 random text files. I just want to know how I populate one array with all the lines from the text files my program is retrieving.

    You can read a textfile line by line and add each line to an ArrayList. An ArrayList is very much like an array only that it's "open ended". You can start adding lines without first knowing how many you're going to get. If you still want an ordinary "static" array when you're finished reading lines you can easily get one from the ArrayList and then drop the ArrayList.

  • How do I cerate an array with a set of numbers lets say 1 through 12 random order but no repeating.

    How do I cerate  an
    array with a set of numbers lets say 1 through 12 random order but no
    repeating.
    I know this should be easy but my brain wont work
    right now
    Solved!
    Go to Solution.

    OK, here's the handmade version.
    It is useful to know that arrays of clusters are sorted by the cluster order of the elements. Simply bundle random numbers with numbers 1-12 in a loop, create an array at the output tunnel, sort the array by the random number, and extract the number array. It will be shuffled.
    Message Edited by altenbach on 06-04-2007 09:20 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    shuffleArray.png ‏5 KB

  • How do I populate a ScrollView with multiple TextView and ImageView?

    Hi there,
    I'm new to development and I'm trying to create an app which includes many views, each with a scrollview containing a combination of blocks of texts and images.
    I can do this awkwardly with Storyboard, but what's the simplest way to setup and populate these through code?
    Thanks,
    Darryl

    Thanks for your response.
    Since writing my first post, I have learned that I cannot
    simply return the 2 dimensional array I create in my CFC. I think I
    need to return an array of structures.
    So now the question is, how do a receive an array of
    structures and stick it into an arrayCollection?
    I get this error:
    TypeError: Error #1034: Type Coercion failed: cannot convert
    mx.collections::ArrayCollection@3ce1251 to Array.
    in this function:
    [Bindable]
    public var acPeriod:ArrayCollection;
    private function wsListResult(event:ResultEvent):void{
    acPeriod= new ArrayCollection(wsList.onePeriod.lastResult);
    }

  • Populate input array with spreadsheet values

    Is it possible to populate an input array with values from a text or spreadsheet file? If so, how is it done?
    Solved!
    Go to Solution.

    Hi Joseph,
    "to be more exact":
    load the [text] file and use "spreadsheet string to array" (older LV versions) or use "read spreadsheet file" (LV8+)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can I create a array with all files from a directory

    How can I create a array of files or varchar with all files from a directory?

    I thought the example could be improved upon. I've posted a solution on my blog that doesn't require writing the directory list to a table. It simply returns it as a nested table of files as a SQL datatype. You can find it here:
    http://maclochlainn.wordpress.com/2008/06/05/how-you-can-read-an-external-directory-list-from-sql/

  • How can I populate a pdf with database data?

    How can I populate a pdf that we have on our server with database data on our server?

    Actually, if you export it in the right format then you won't need a script
    at all.
    You can import data directly into fields from a plain-text file via Tools -
    Forms - More Form Options - Import Data...
    I believe the format is tab-delimited with the field names in the first row
    and their values in the second.

  • How can i populate the Jcombobox with the data from my jpa list? Desperate

    I need to populate my jcombobox with data from my jpa. This is my first time trying this and i just need some sample or a quick solution to this. Thanks in advance
    <code>
    public static MyNames myNames() {
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("JavaTrialsPU");
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    Query q = em.createNamedQuery("MyNames.findAll");
    MyNames n = (MyNames) q.getResultList();
    return n;
    public static void myCombo() {       
    comboBox = new JComboBox(????--how can i make the jcombobox display my myNames() list--?????);
    frame.add(comboBox, BorderLayout.PAGE_START);
    </code>

    Implement toString() on your entity to return whatever you want to use as a label for the combobox.
    Your need for quick solutions is very destructive to your learning process. In stead take the time and read around a little. Swing happens to have an excellent tutorial with many example programs readily available for you to pick through:
    http://docs.oracle.com/javase/tutorial/uiswing/
    And PS: you need to use \ tags in this forum.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to dynamically populate a listbox with the values in the database

    Hi,
    How do dynamically populate the list box with the values in the oracle database. I want to load the list box at run time.Plz anybody help me out to find a solution for this problem.
    Thanks in advance...
    Regards,
    Shiva.

    u can wite code like this..on jsp page
    <%
    ResultSet rs = stmt.executeQuery("select vender_name from vendors");
    %>
    <select name = "vendorlist">
    <%
    while(rs.next()){
    String vname = rs.getString(1);
    %>
    <option value="<%=vname%>"><%=vname%></option%>
    <%
    rs.close();
    %>

  • Amplitude Array with niFgen Frequency List Mode

    I was wondering if there was a way to easily set a different amplitude for each frequency in a Frequency List?  Ideally I would want this to be in an array.
    When using Frequency List Mode, you can define the frequencies and durations in an array using the Create Frequency List VI:
    However the Configure Frequency List VI only allows you to specify a single value for the amplitude:
    The only approach I can think of is using Property Nodes, however that seems like it will be an exact solution.  Trying to increase the amplitude (or gain) "on-the-fly" seems to cause discontinuities and has some delay before taking effect.
    I am looking for something similar to this example, except with another column for unique amplitudes for each segment of the list:
    Does anyone know how I might go about this?  Any approaches/ideas will be greatly appreciated!  Thanks in advance!
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!

    Hello,
    With the Frequency List mode, you are limited to outputting varying frequencies of a standard function at a certain amplitude.  To do what you're describing you would want to use either Arbitrary Waveform or Arbitrary Sequence mode with a capable card instead.  A good example of doing this on the fly with Arbitrary Waveform can be found here: https://decibel.ni.com/content/docs/DOC-8391.
    Matt Lee
    National Instruments
    Applications Engineer

  • How can I populate the users in the Directory Server?

    Hi all,
    I'm a new of Sun ONE Directory Server 5.2, I've just install a copy of it on Win2000 server and I have a small question to ask.
    How can I populate the users (This user can be use to login in to Sun ONE install messenger) in the Directory Server using the Directory server's admin console?
    Thanks in advance,
    Tuan Anh,

    Thanks Ramnath,
    I've read your suggest, but actually, I really wanted to know how to populate user and password. I've read some thing below in Sun ONE Directory 5.2 Getting Started Guide.pdf
    � o=userRoot
    During installation, a user database is created by default. The default name of
    the user database is o=userRoot. You can choose to populate this database at
    installation, or to populate it later.
    But I don�t know the related document, I have create successful user and pass by using admin console. But can not user this user to login in to Instant messenger.
    I'm looking forward to receive your help
    Tuan Anh

  • How do I create an array with variables also splits words  in a txtfile?

    Hello guys,
    I made a script that reads a text file.
    function readMyFile()
    var myFile=File(app.activeDocument.filePath + "/LareLog.txt");
    if (myFile.exists)
            myFile.open("r");
            var Temps =  myFile.read();
            alert (Temps);                          // message the content
            var nyRad=("\n");                    // break the line
            textArr=Temps.split(nyRad);
            alert(textArr);                          // message the content with all info on new lines ("\n");
            myFile.close();
    my textfile contains:
    ~/Desktop/3.indd ,Thu Mar 20, 2014, 11:26:34 , GMT+0100
    I wonder how do I sort the content in array
    in this order, also creates variables for each string.
    var= string 1[~/Desktop/3.indd]
    var2=string 2[11:26:34]
    var3=string 3[11:26:34]
    var4=string 4[2014]
    var5=string 5 [GMT+0100]
    Thank you in advance people.

    Hmmh?
    Jump_Over said it before: „… are stored as separate array's elements …“ in your [textArr]
    So you can create now variables on this way:
    var string_1 = textArr[0]; // and so on
    alert(string_1);
    See Java Scripting reference for more examples how to use Arrays.

  • Tabular form - how to auto populate a column with the user name

    Hi,
    I have a tabular form with 3 columns - (customer name, notes, user). my users are allowed to enter customer details in the notes section... as soon as the user completes notes section and save the form, I want "USER" field to be auto populate with the user name so that I may track activity by the user...
    Please advice how to accomplish it...
    thanks in advance

    Hi,
    After user saves the forms that means commit to the database, so you can simply write a trigger like:
    CREATE OR REPLACE TRIGGER "AUDIT"
    before insert or update on TABLE1
    for each row
    begin
    :new.user_field := nvl(v('APP_USER'),user);
    end;
    Regards,
    Aljaz
    Edited by: Aljaz on 4.3.2012 22:03

  • How can I convert an array with varying length into a cluster

    Hi,
    I need to convert an array of n elements into a cluster. Usually, it only involves the "Array to Cluster" function. But since the array length is not constant and the number of elements in the function is constant and can not be changed programaticaly, I need to find another way to do that.
    Any ideas?
    Thanks.

    Hi,
    I also tried to do this but without success. I think that's not possible.
    For me it's a general problem using labview. I often wanted to generate standard controls dynamically which is not possible (or I haven't found the solution yet). So I think that's the reason why you can't create a cluster during runtime (the program would have to add controls dynamically to the cluster).
    Do you have an upper limit for your array-size? Although it needs a lot more memory, it would be a possibility to create the cluster with the maximum number of elements.
    If you don't have a maximum, you will have to look for another way, I'm afraid.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • How do I populate h:selectOneMenu with a sequence of numbers?

    Hi,
    I would think this would be simple, but I cannot figure out how to get it to work for the life of me. I want to have a drop down list box populated with sequential numbers. I tried this, but it fills it with blanks (I think that's what it did, I tried so many things I am forgetting what did what):
    <h:selectOneMenu value="#{query.response}">
    <c:forEach var="i" begin="1" end="31">
    <f:selectItem itemLabel="#{i}" itemValue="#{i}"/>
    </c:forEach>
    </h:selectOneMenu>
    I got it to fill with zeros if I say "#{0 + i}".
    I am new to JavaServer Faces, but I think it's because the loop happens early, and the # expression is deferred and happens after "i" no longer exists.
    How do I accomplish this? Any help is appreciated. I searched the net far and wide and could not find a solution (which seems weird, I would think this would be a common thing to want to do).
    Thanks.

    Use f:selectItems and let the backing bean return a List<SelectItem> with the desired values.
    <h:selectOneMenu value="#{myBean.selectedItem}">
        <f:selectItems value="#{myBean.selectItems}" />
    </h:selectOneMenu>
    private Integer selectedItem; // + getter + setter.
    private List<SelectItem> selectItems; // + getter.
    public MyBean() {
        fillSelectItems();
    private void fillSelectItems() {
        selectItems = new ArrayList<SelectItem>();
        for (int i = 1; i <= 31; i++) {
            selectItems.add(new SelectItem(new Integer(i)));
    }PS: if you want to create kind of a calendar selection, rather look for existing components such as Tomahawk Calendar: [http://myfaces.apache.org/tomahawk/calendar.html].
    Edited by: BalusC on 19-jun-2008 11:41

Maybe you are looking for

  • Connection to [i]server[/i] failed (Error NT_STATUS_IO_TIMEOUT)

    Hi there, I'm a long time linux user (casual) and have recently got hold of a machine that I am using as a server. I am able to SSH into this fine from my laptop and I am doing all the setup from ssh. I am trying to set it up so I can use Samba, howe

  • Document in R3 Server

    Hello Can anybody gives input how to save document in R3 system itself, instaed of saving in other network/server can we save document in R3 in an indexed manner. So that data maintenance will be secured and DR ensured Regards Dinabandhu

  • PC to Mac iPod nano user

    I've had my nano for over a year now and haven't had any problems going from a PC to a Mac. . .until today. My nano is formatted for a PC, but I've been able to play the music on my Mac at work. Not today. It seems like all the music has been deleted

  • Please help ID a screen I've never seen before

    OK, I'm working along this morning on effects in my Viewer. At some point I looked over at my Canvas and there is a frame from my project with the clip name overlayed at the top and the timecode overlayed on the bottom. Now, this is not the standard

  • Trouble with Adobe Reader Installation

    I am trying to download Adobe Reader. After I click Install Now, it directs me to go to my download file and double click on Adobe Reader Installer to continue. I don't know where to find this. I don't have Adobe Reader Installer in my download file.