Simple file i/o script question (newbie)

OK - I'm going brain dead.  I'm new to applescript and my script works great except for one piece.  I need to keep a count of how many iterations my script does each time I use it, so my thought was to have a file called serial.txt that starts with a value of 0.  The script would open this file and set a variable to its value (say iterationnum).  Upon each iteration within the script it would increment iterationnum.  Upon script completetion, it would replace the value in serial.txt with the new value of the variable iterationnum and close the file.  Next time I run the script, the value of iterationnum would continue where I left off.  Iternationnum could go as high as 100,000 or so.
it's simple enough but I can't seem to get the i/o syntax correct.  Would one of you seasoned gurus be kind enough to post an example of this? 
Your time is very much appreciated

If you really want to do it as a file here is some code to get you started
-- set the file path and file name and open the file for writing
-- will create it if not already there
set theFile to (path to desktop as text) & "ASCtest"
set fd to open for access theFile with write permission
-- Try to read the file the first time it will error nothing to read
-- catch the error and set the count to 0
try
          set runCount to read fd
on error enum --  first time no data read
          set runCount to 0
end try
-- increment runCount
set runCount to runCount + 1
-- Go back to the beginning of the file and
-- write out the new run count.
try
  set eof of fd to 0
  write runCount as string to fd
on error enum
  display alert enum
  close access fd
end try
-- close the file
close access fd
display alert "runCount: " & runCount

Similar Messages

  • FLASH MX 2004 action script question

    Hi!
    I need to create an script for a basic function; when mouse goes over a moveclip, that works also link, I want it to trigger an invisible red dot on a nerby map. I have created a movieclip and named it "red", it's a 1 sec clip with nothing in the beginning and a red dot in the end. I want this dot to trigger and show only when mouse goes over this specific link, otherwise it must be invisible.
    I know this is pretty basic stuff and I have done this before few years back but I have forgotten how to do it and need help now.
    Any help would be very much appreciated :-)
    Kim

    I still need help, this problem is little more complicated;
    I can manage making the red dot visible and invisible by triggering roll over and roll out on a button.
    The problem is, I have a navbar which is line of flags made to a movie clip, with 5 invisible buttons. These buttons are configured to do three different actions; get URL, trigger a light effect and a movement effect.
    Now I need this invisible button to trigger my red dot also so that when mouse is over a certain flag a red dot appears on a map on the correct location.
    I have the red dot on a new layer. It has instance name "redDot" and on the very first frame of this red button layer, I have action script that says: redDot._visible = false;
    This works as it should and the dot is invisible when the movie has loaded.
    I need to make this invisible button to trigger the visibility of my red dot, and I have tried to add the code:
    on (rollOver) {
    redDot._visible = true;
    on (rollOut) {
    redDot._visible = false;
    to this invisible button, but it dosent work, furthermore it affects the other functions of the button/movie clip, which were working fine before.
    Here is the code attached to this invisible button so far:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2);
    on (rollOut) {
    gotoAndPlay("sec");
    I have the URL:s on an external text file.
    So my question is; where do I add the action script to make it visible when moving the mouse over this invisible button? To my understanding, it should go in the same place as the other code that is working, but I'm doing something wrong...
    I tried to do this:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2)
            redDot._visible = true;
    on (rollOut) {
    gotoAndPlay("sec")
    redDot._visible = false;
    But it is wrong, I also tried like this:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2);
    on (rollOut) {
    gotoAndPlay("sec");
    on (rollOver) {
    redDot._visible = true;
    on (rollOut) {
    redDot._visible = false;
    But it makes the other functions that worked to stop working.
    I also tried to give the invisible button an instance name and do it like this:
    invisible.on (rollOver) {
            redDot._visible = true;
    invisible.on (rollOut) {
    redDot._visible = false;
    And put them in the actions layer of button movie clip but nothing works.
    Flash is really giving me a headache now...
    To conclude, I made a simple test button, put it on the scene somewhere and and attached the rollOver and rollOut codes, targeting the "redDot" and it works fine, the button didn't need a instance name to work. I don't understand why I can't make it to work with the invisible button where it should be.
    I hope this clarifies the point and I can get some help with this and sorry for bothering again with this problem.
    Oh and I use old Flash MX 2004.
    Thanks
    Kim

  • Help with file uploader, php script, Windows Authentication

    I am trying to setup a really basic web-based file uploader that I will expand upon later. I have the flex application working well enough (very basic). However, I have a php script in a secure folder using windows authentication. When I try to send the file to the script, it doesn't seem to like my credentials, and refuses to do anything. I do not get an error message; just nothing happens.
    My questions are:
    Does anybody know where I should've looked before posting this thread?
    Do I even have PHP set up correctly? (At first I just made a txt file and put a .php extension on it, then I tried to setup PHP on the server, but it was a little confusing for me)
    Is Windows Authentication the problem?
    I do plan on implementing SQL Server in the future (to keep track of Files and user-defined attributes for files), but I do not want to store the files in SQLserver, just their pathnames.
    Is there a simple way to use ColdFusion (for free) to acheive this end?
    I am somewhat experienced at coding applications, but am totally new to server-side scripts.
    This is my php script:
    <?php
    $tempFile = $_FILES['Filedata']['tmp_name'];
    $fileName = $_FILES['Filedata']['name'];
    $fileSize = $_FILES['Filedata']['size'];
    move_uploaded_file($tempFile, "./" . $fileName);
    ?>
    This is my flex application:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Script>
         <![CDATA[
         private var fileRef:FileReference
         private var uploadFilePath:String
         private function selectFile():void
              fileRef = new FileReference();
              fileRef.addEventListener(Event.SELECT, fileRef_select);
              fileRef.browse();
         private function fileRef_select(evt:Event):void
              fileRef.upload(new URLRequest("http://SERVERLOCATION/PDFUploader.php"));
         ]]>
    </fx:Script>
         <s:Button top="30" left="5" label="Browse" click="selectFile()"/>
    </s:Application>
    Thanks to any who take the time to respond.

    Hey, so far all I have found is this tutorial.. I'm about to try it out
    http://www.smartwebby.com/Flash/external_data.asp

  • Does simple file and folder sharing on an iMac work with OSX Server?

    Hi There
    I wonder if I should install OSX Server on an iMac wher several users work on the same files and folders.
    My question - before I do something I might regret:
    Does simple file and folder sharing on an iMac within several users really work with the help of OSX Server?
    All I want to be able to do:
    Admin creates a new folder1 and gives it read- and write access for user1 and user2.
    User1 creates a subfolder1 in folder1, and a document1 in subfolder1.
    User2 edits document1. Later Admin edits document1.
    All these simple editing of files and folders (and subfolders) within a main folder should be possible. This is not possible now.
    Is everything clear? I'm not a network specialist or something, I just want to give some co-workers access to some data on my computer without problems.

    So what you need are recursive permissions.
    I suggest you create a group and add user1 and user2 to that group. You can name that group whatever you want, but for now i will call it FSUsers
    Execute this in terminal. Replace FSUsers with your new group
    sudo chmod -R +a "FSUsers allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextat tr,writeextattr,readsecurity,file_inherit,directory_inherit" /Users/Shared/*
    Replace /Users/Shared with the location of your shared folder. Make sure you keep the /* at the end (this allows all subfolders and files to get the same permissions.
    If you need to add people to the share just add them to the FSUsers group, the FSUsers group should should also be allowed in the sharing preferences.

  • Simple file to file transfer.  Pls advice urgent

    Hi All,
    I have Simple file to file transfer.
    There are text files at source side that need to send at receiver side.
    Source text files name are different so I have used
    Adapter Specific Attributes for Sender and Receiver Adapetrs
    Question
    As these are text files and there is no mapping required what interface name should I give at Sender Aggrement and
    at Interface Determination.
    Pls describe steps
    Regards

    Rider,
    Its very simple scenario. For ur satisfaction I did the same, it's working perfectly. I don't know what mistake u did. Let me give the complete picture.
    Step1: Create new Scenario
    Step2: Create new Business Service, let say File_BusService
    Step3: In File_BusService add the outbound and Inbound Interface name and namespaces , like
    Outbound Interface: MyInterface
    Outbound Interfacenamespace: http://my-own-namespace.com
    Inbound Interface: MyInterface
    Inbound Interfacenamespace: http://my-own-namespace.com
    Step4: Create two communication Channels under File_BusService
    Step5: Receiver Determination.
    Sender:File_BusService
    Outbound Interface: MyInterface
    Outbound Interfacenamespace: http://my-own-namespace.com
    Configured Receivers
    File_BusService
    Step6: Interface Determination.
    Sender:File_BusService
    Outbound Interface: MyInterface
    Outbound Interfacenamespace: http://my-own-namespace.com
    Inbound Interface: MyInterface
    Step7: Receiver agreement
    Receiver Service: File_BusService
    Inbound Interface: MyInterface
    Receiver Comm.channel
    Step8: Sender Agreement.
    Sender:File_BusService
    Outbound Interface: MyInterface
    Outbound Interfacenamespace: http://my-own-namespace.com
    Sender Comm.channel.
    raj.

  • ANT how to include NetBeans Jar  files in my script of ANT ??

    ANT how to include NetBeans Jar files in my script of ANT ??

    I mean the library say swing layout ...
    which is SwingLayOuts1.0.jar ...
    in side this there is folder org.jDesktop....
    I want this folder in my jar file ...
    also ....
    My question ... i know the path of the jar file of NetBeans .... i can copy that ...dirctly ... but if m using Netbeans editor ... can i give NetBeans class to my jar command for ANT...........

  • Simple file loader with cffile

    Hello;
    I'm trying to make a basic file loader for my web site. I've written the file upload, and it works. I'll attach that code. I was wondering if someone could help me over this small hurdle I need to get past... let me explain.
    I have an admin section in my web site. This file loader is to add new thumbnail images to a db record and show it on the front end. There is an option to either edit and existing record, or add a new record.
    When you get to the editor, I'm putting in a link for a pop up window that has this file loader in it. What I want to do it after you load this file, I need it to be able to close the window and add it to the editor section so the file name can be loaded into the database.
    Is this possible and kind of simple? I realize nothing is too simple doing this kind of programming, I'm just trying to find a decent solution that works. Maybe there is a tutorial out there for this kind of thing? Or maybe someone can help me with a couple lines of code so I can take it from there?
    This is my file loader:
    <cfset UploadFolder="c:\Inetpub\wwwroot\website\img\babies">
    <cfif IsDefined("Form.UploadFile") AND Form.UploadFile NEQ "">
    <cffile
         action="upload"
            filefield="UploadFile"
            destination="#UploadFolder#"
            nameconflict="overwrite"
            >
    File uploaded successfully!
        <br />
        Uploaded file: <cfoutput>#cffile.ClientFile#</cfoutput>
    <cfelse>
    Select a file first!       
    </cfif>
    <form name="UploadForm" method="post" enctype="multipart/form-data" action="">
    <input type="file" name="UploadFile">
        <input type="submit"  name="submit" value="Upload"/>
    </form>
    I can also post the db code for the page I'm loading it into if need be. I would have to refresh the page I believe to get the info from the pop up to the parent window that spawned it. I have a script for that:
    <a href="javascript:opener.top.location=('/test/edit-record.cfm');" onclick= "javascript:window.close();">close window</a>
    can anyone help me make this work properly? OR point me in a direction of a tutorial for a simple file loader of this type?
    thank you.

    I was wondering if Ajax would be a good solution. Can you tell me this
    ? I have a file loader I use all the time, but on this server, it's not working properly. Can you look at my code and possibly tell me why? I
    know this is a lot of code I'm pasting, but it is pretty strait forward. It doesn't thrown an error, it just doesn't load the file
    at all.
    I would rather use this, I have it all written:
    <!--- form submitted --->
    <!--- set file uploading vars --->
    <cfparam name="fileuploaded" type="boolean" default="false">
    <cfparam name="uploadedfile" default="">
    <cfset pathToFile = "c:\Inetpub\wwwroot\website\img\babies">
    <!--- --->
    <cfif len(trim(form.MYFile))>
    <!--- if a file has been selected --->
    <!--- try uploading new file --->
    <cftry>
    <cffile Action="upload" filefield="MYFile" accept="image/gif,
    image/jpg, image/jpeg, image/pjpeg"
    destination="#pathToFile#" nameconflict="MAKEUNIQUE">
    <cfset fileuploaded = true>
    <cfset uploadedfile = cffile.serverfile>
    <cfcatch type="any">
    <!--- if upload did not suceed, reset file uploading vars --->
    <cfset fileuploaded = false>
    <cfset uploadedfile = "">
    <!--- this can be further enhanced by setting some var to hold error
    message and return it to user --->
    </cfcatch>
    </cftry>
    </cfif>
    <cfif form.id gt 0><!--- we are updating an existing record --->
    <!--- if new file upload was successful and the feature has an image
    associated with it - delete old image --->
    <cfif fileuploaded is true AND len(trim(form.oldimage))>
    <cfif FileExists(pathToFile & form.oldimage)>
    <cffile action="delete" file="#pathToFile & form.oldimage#">
    </cfif>
    </cfif>
    <cfquery datasource="#APPLICATION.dataSource#">
    UPDATE baby_port
    SET
    baby_port.dob=<cfqueryparam cfsqltype="CF_SQL_DATE" value="#form.edit1#">,
    baby_port.Fname=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.Name#">,
    baby_port.Lname=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.Lname#">,
    <cfif fileuploaded is true>
    baby_port.MYFile=<cfqueryparam cfsqltype="cf_sql_varchar" value="#uploadedfile#">,
    </cfif>
    baby_port.Body=<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#form.PDSeditor#">,
    baby_port.weight=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.weight#">,
    baby_port.TimeB=<cfqueryparam cfsqltype="CF_SQL_TIME" value="#form.tob#">
    WHERE ID = <cfqueryparam value="#form.ID#" cfsqlType="CF_SQL_INTEGER">
    </cfquery>
    <cfelse><!--- we are inserting a new record --->
    <cfquery datasource="#APPLICATION.dataSource#">
    INSERT INTO baby_port
    (dob, Fname, Lname, MYFile, Body, weight, TimeB)
    VALUES
    (<cfqueryparam cfsqltype="CF_SQL_DATE" value="#form.edit1#">,
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.Name#">,
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.Lname#">,
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#uploadedfile#" null="#NOT fileuploaded#">,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#form.PDSeditor#">,
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.weight#">,
    <cfqueryparam cfsqltype="CF_SQL_TIME" value="#form.tob#">)
    </cfquery>
    </cfif>
    this is the 2 fields on the form that is submitting the file:
    <input type="hidden" name="oldimage" value="#MYFile#">
    <input name="MYFile" type="file" id="MYFile">
    I can make more available if you need it, I didn't want to unload a ton of code on you.This is a stand alone server running coldfusion 8.1 standard if that makes a difference, it is not a shared environment. I have this code working on shared environments.

  • Can we integrate .swf file in java script ?

    Hello Friends,
    We implemented one concept in Flex and now would like to integrate with JavaScript. Earlier we integrated an Applet code but now, we developed the concept in Flex, however, I am unable to integrate the concept in java script.
    Can anyone help me out with the procedure to integrate flex swf file in java script ?
    Here is my earlier java script code :
    var file=gup('query');
    //document.write(file);
    var prevFile=gup('prevFileName');
    //document.write(prevFile);
    document.write("<table align=\"center\"><tr><td><applet code=\"MyApplet.class\" archive=\"Visual.jar\" width=1000 height=500>");
    document.write("</applet></td></tr></table>");
    function gup( name )
      name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
      var regexS = "[\\?&]"+name+"=([^&#]*)";
      var regex = new RegExp( regexS );
      var results = regex.exec( window.location.href );
      if( results == null )
        return "";
      else
        return results[1];
    Thanks in advance.

    What version of FlashPro are you using? If you want a self contained app that doesn't load external resources, publish an AIR app, which will work on Windows or OSX. I'm using OSX so I can't really help with .exe projector files, but it looks like the latest version of FlashPro no longer outputs projector files—I think everything is AIR now.
    If you really want to go the projector route, I'm guessing Jeffrey Smith's suggestion of finding an older version of Flash Player would be simpler.
    So for AIR, set your Publishing target to AIR for Desktop. Then under File>AIR settings:
    Output as: Application with runtime embedded
    Include files: Add all of your resources—the swf ID generated and it's resource folder
    In the Signature tab click New to create a self-signing Certificate (if you were developing commercial software you would need a third party certificate). You can save the certificate anywhere.
    When you publish you should find an AIR application file (.app) file in the directory with your .fla

  • How to pass values from single Databank file across different scripts?

    Hi Guys,
    I have a question regarding using single databank file across different scripts.
    Lets say there 5 web service scripts and these are very generic scripts where the input/request xml schema of each script is parameterized without having any databank as script asset.
    These 5 web service scripts are like library functions and so we dont want to attach any databank as script asset.
    However I have a driver script to call all of these 5 library scripts and now I attach a databank (a .csv file) to the driver script as script asset. Say this .csv file has got 10 different columns with just single record/row.
    As and when the function call goes to those 5 scripts i.e one by one, then based on the function call the corresponding columns are used and the data for those columns must be read.
    Is there any solution to acheive this?
    Faster help is highly appreciated.

    Hi JB,
    what i was looking for, was an approach to use a databank file (.csv file) in a parent script and then by reading that .csv file, the data should be moved from the parent script to individual child scripts.
    The child scripts are very generic scripts and are like library functions which are not data dependent. they are fully parameterized and they dont have any sort of databank attached to them.
    Now the question is if the databank has got 10 columns where first 3 columns belong to one child script, second 3 columns belong to 2nd child script and so on.
    Then how do we pass the values from parent script to a child script and what is the best/recommended approach.

  • Scripting Question - Very Basic

    Hello, I'm using the trial version of InDesign and am wondering if because it's the trial version that I can't load custom scripts from Adobe?  I've downloaded and installed a Custom Calendar script [I can see the extracted files in/on my PC] but the app apparently doesn't see it.  Any help you can offer is greatly appreciated.  Thanks, 

    Thank you so much, you were spot on. 
    From: Peter Spier <[email protected]>
    To: Friar5 <[email protected]>
    Sent: Monday, December 12, 2011 3:18 PM
    Subject: Scripting Question - Very Basic
    Re: Scripting Question - Very Basic created by Peter Spier in InDesign - View the full discussion
    Have you put thew script in a location that InDesign uses for scripts? See How to install scripts in InDesign | InDesignSecrets
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4079869#4079869
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4079869#4079869. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in InDesign by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Saving PDF files as Post Script files using Adobe Professional

    I have a 2 Page  PDf document that mainly has Text on each page. Both the Pages have a 2D Data Matrix Barcode also.
    I opened the PDF file in Adobe Professional and saved the file as Post Script file.
    Post Script file gets saved successfully. When I open the Post script file - It has almost 40,000 line for a 2 page post scipt file.
    It has lot of Hex data that looks so huge in the file. ( I thought only Images get converted to Hex format).
    Is there a setting or something I am missing that I have this huge Post script file for a 2 page text file PDF

    Your barcode may be a high resolution graphic. A lot of junk (hex) is what you would see in such a case with PS. How it looks to you may depend on what application you are using to view the PS file. If you open it in a code or text editor you might get a better idea of what is there. I don't look at PS files much and agree with graffiti's question of why do you want to?

  • Need help with simple file sharing application

    I have an assignment to build a Java File Sharing application. Since I'm relatively new to programming, this is not gonna be an easy task for me.
    Therefore I was wondering if there are people willing to help me in the next few days. I will ask questions in this thread, there will be loads of them.
    I already have something done but I'm not nearly halfway finished.
    Is there a code example of a simple file sharing application somewhere? I didn't manage to find it.
    More-less, this is what it needs to contain:
    -client/server communication (almost over)
    -file sending (upload, download)
    -file search function (almost over)
    -GUI of an application.
    GUI is something I will do at the end, hopefully.
    I hope someone will help me. Cheers
    One more thing, I'm not asking for anyone to do my homework. I will only be needing some help in the various steps of building an application.
    As I said code examples are most welcome.
    This is what I have done so far
    Server:
    package ToJeTo;
    import java.io.*;
    import java.net.*;
    public class MultiServer {
        public static ServerSocket serverskiSoket;
        public static int PORT = 1233;
        public static void main(String[] args) throws IOException {
            try {
                serverskiSoket = new ServerSocket(PORT);
            }catch (IOException e) {
                System.out.println("Connection impossible");
                System.exit(1);
            do {
                Socket client = serverskiSoket.accept();
                System.out.println("accepted");
                ClientHandler handler = new ClientHandler(client);
                handler.start();
            } while(true);
    }Client:
    package ToJeTo;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.net.*;
    import java.util.Scanner;
    public class MultiClient {
        public static InetAddress host;
        public static int PORT = 1233;
        public static void main(String[] args) {
            try {
                host = InetAddress.getLocalHost();
            }catch (UnknownHostException uhe) {
                System.out.println("Error!");
                System.exit(1);
            sendMessages();
        private static void sendMessages() {
            Socket soket = null;
            try {
                soket = new Socket(host, PORT);
                Scanner networkInput = new Scanner(soket.getInputStream());
                PrintWriter networkOutput = new PrintWriter(soket.getOutputStream(), true);
                Scanner unos = new Scanner(System.in);
                String message, response;
                do {
                    System.out.println("Enter message");
                    message = unos.nextLine();
                    networkOutput.println(message);
                    response = networkInput.nextLine();
                    System.out.println("Server: " + response);
                }while (!message.equals("QUIT"));
            } catch (IOException e) {
                e.printStackTrace();
            finally {
                try{
                    System.out.println("Closing..");
                    soket.close();
                } catch (IOException e) {
                    System.out.println("Impossible to disconnect!");
                    System.exit(1);
    }ClientHandler:
    package ToJeTo;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class ClientHandler extends Thread {
        private Socket client;
        private Scanner input;
        private PrintWriter output;
        public ClientHandler(Socket serverskiSoket) {
            client = serverskiSoket;
            try {
            input = new Scanner(client.getInputStream());
            output = new PrintWriter(client.getOutputStream(), true);
            } catch (IOException e) {
                e.printStackTrace();
            public void run() {
                String received;
                do {
                received = input.nextLine();
                output.println("Reply: " + received);
                } while (!received.equals("QUIT"));
                try {
                    if (client != null)
                        System.out.println("Closing the connection...");
                        client.close();
                }catch (IOException e) {
                    System.out.println("Error!");
    }Those three classes are simple client server multi-threaded connection.

    Now the other part that contains the search function looks like this:
    package ToJeTo;
    import java.io.*;
    import java.util.*;
    public class User {
        String nickname;
        String ipAddress;
        static ArrayList<String> listOfFiles = new ArrayList<String>();
        File sharedFolder;
        String fileLocation;
        public User(String nickname, String ipAddress, String fileLocation) {
            this.nickname = nickname.toLowerCase();
            this.ipAddress = ipAddress;
            sharedFolder = new File(fileLocation);
            File[] files = sharedFolder.listFiles();
            for (int i = 0; i < files.length; i++) {
                listOfFiles.add(i, files.toString().substring(fileLocation.length()+1));
    public static void showTheList() {
    for (int i = 0; i < listOfFiles.size(); i++) {
    System.out.println(listOfFiles.get(i).toString());
    @Override
    public String toString() {
    return nickname + " " + ipAddress;
    User Manager:
    package ToJeTo;
    import java.io.*;
    import java.util.*;
    class UserManager {
        static ArrayList<User> allTheUsers = new ArrayList<User>();;
        public static void addUser(User newUser) {
            allTheUsers.add(newUser);
        public static void showAndStoreTheListOfUsers() throws FileNotFoundException, IOException {
            BufferedWriter out = new BufferedWriter(new FileWriter("List Of Users.txt"));
            for (int i = 0; i < allTheUsers.size(); i++) {
                    System.out.println(allTheUsers.get(i));
                    out.write(allTheUsers.get(i).toString());
                    out.newLine();
            out.close();
    }Request For File
    package ToJeTo;
    import java.util.*;
    public class RequestForFile {
        static ArrayList<String> listOfUsersWithFile = new ArrayList<String>();
        Scanner input;
        String fileName;
        public RequestForFile() {
            System.out.println("Type the wanted filename here: ");
            input = new Scanner(System.in);
            fileName = input.nextLine();
            for (User u : UserManager.allTheUsers) {
                for (String str : User.listOfFiles) {
                    if (str.equalsIgnoreCase(fileName))
                        listOfUsersWithFile.add(u.nickname);
        public RequestForFile(String fileName) {
            for (User u : UserManager.allTheUsers) {
                for (String str : User.listOfFiles) {
                    if (str.equalsIgnoreCase(fileName))
                        listOfUsersWithFile.add(u.nickname);
        public static List<String> getAll() {
            for (int i = 0; i < listOfUsersWithFile.size(); i++) {
                //System.out.println("User that has the file: " + listOfUsersWithFile.get(i));
            return listOfUsersWithFile;
    }Now this is the general idea.
    The user logs in with his nickname and ip address. He defines his own shared folder and makes it available for other users that log on to server.
    Now each user has their own list of files from a shared folder. It's an ArrayList.
    User manager class is there to store another list, a list of users that are connected with server.
    When the user is searching for a particular file, he is searching through all the users and their respective files lists. Therefore for each loop inside a for each loop.
    Now the problem is how to connect all that with Client and Server class and put it into one piece.
    GUI should look somewhat like this:

  • Share files in ibook - networking question

    Hello, I have a networking question.
    I have a brand spakin' new 13' MacBook Pro and an older 14' iBook G4 (with a broken airport wireless card).
    My internet is set up so that I have the modem connected to a "wired" ethernet hub, then to an airport express. This way I have wireless for my new MacBook Pro, and I can connect my old iBook to the internet with a ethernet cable.
    Herein lies my question: I want to access all my files on my ibook from my MacBook Pro. I've tried the file sharing and etc on system preferences, but for some reason it still doesn't work. I believe its because they are on different networks? (one wireless, one wired?)
    Any ideas to make my ibook a simple file server.

    Try repairing disk permissions.
    *"The external HD has two partitions, one is a backup of the ibook, and the other has mixed media. When I access my ibook over the network, Only the backup partition appears, and not the mixed media partition. "* Try repairing permissions but not sure if that's going to work. Can't hurt to try.
    Launch Disk Utility. Select MacintoshHD in the panel on the left, select the FirstAid tab. Click: Repair Disk Permissions. When it's finished from the Menu Bar, Quit Disk Utility and restart your Mac.
    Also, your profile indicates you are running 10.4.3. If that is the case, you might want to run Software Updates (from the Apple Menu , then click Software Updates.
    Message was edited by: Carolyn Samit

  • Unique Script Questions-timed startup?

    Hello All,
    I am long time mac fanatic with some unusual script questions. I have a project ongoing where I will need to put my pb 15" in a remote location with a Canon camera. Canon has transmitter device which will allow me via ethernet to ftp to my pb.
    Here's essentially what I need to the script to do and I am trying to find out just how feasible this is. I need my laptop to bootup to receive photos via ftp at a certain time period. The camera will send to the builtin ftp software. Once booted I need the script to hold for period of about an hour. Once time has elapsed I need the script to connect to the internet via a broadband EVDO card. We are using one of the EVDO cards built in to Tiger. It then must ftp a folder of images to a remote server.
    Simple, huh? : ) I am running Transmit as my ftp software. I believe it is scriptable and will watch a folder to send.
    Any ideas? I'd love to hear them. I can be reached via scott at scottaudette.com.
    This setup is going be used in very cool photo location but I can't publicly announce where.
    Scott
    G5 and PB 15"   Mac OS X (10.4.7)  

    'Transmit ... I believe it is scriptable' - yes it is. Go to How can I use AppleScript with Transmit? to download sample 'Transmit' scripts.
    'Once booted I need the script to hold for period of about an hour.' - well then, save the script as a 'stay open' application, with an 'on idle () ... end idle' handler - with a return of (60 * 60) seconds; and then drag the saved application onto the 'System Preferences' 'Accounts' 'Login Items' tab's list - of the user which the Mac will boot to (when turned ON).
      Mac OS X (10.4.4)  

  • Can I call host file ( Unix Shell script ) from Oracle 10g trigger

    Hi,
    I am new to Oracle 10g. Can I call host file ( unix shell script ) from Oracle 10g trigger ?. I know it is possible. Pl explain me with small example
    thanks & regards
    parag

    user12009546 wrote:
    Hi,
    I am new to Oracle 10g. Can I call host file ( unix shell script ) from Oracle 10g trigger ?. I know it is possible. Pl explain me with small example
    thanks & regards
    paragIf you are in 10g, you can simple call shell script from DBMS_SCHEDULER:
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'TEST_SCRIPT',
    job_type => 'EXECUTABLE',
    job_action => 'PATH_OF_YOUR_SCRIPT',
    start_date => SYSDATE,
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
    enabled => TRUE,
    comments => 'Shell script from Oracle'
    END;
    /

Maybe you are looking for

  • LED on power adapter doesn't always light?

    I have two power adapters, on one the LED lights all the time and is either green when recharged, or orange when charging. Another has an intermittent behavior as far as the lighting is concerned, and won't light up when it is charged. The menubar sh

  • Associating APP_USER with file stored in database

    I'm using APEX 3.0 with 10g database. I have an invoice report that references the APP_USER as the person who generated the invoice, and his or her name appears at the bottom of the invoice. I need a way to associate the person who is the APP_USER wi

  • How to create an spool request

    Hi guys,            can any one tel me how to write an table content into an spool. points wil be rewarded ravi null

  • Report detail subform question

    I've got a report that within the detail area has a recurring series of detail sections that have an identical header row but that are variable in length (number of rows). I'm tasked with getting as many of these detail subsections as possible on eac

  • HELP! Embed PDF Font for Qoop Document

    I am attempting to create a book for qoop.com; howevver every time I attempt to upload the pdf, created in Adobe Acrobat (version 6.x), I get an error message stating that "The file you uploaded contains non-embedded fonts that we cannot print. Pleas