Sending Files over a Windows Network

I am trying to send files from one computer to the other over a windows network. I have absolute path names of the two locations.
Can you just use "File.renameTo(File);" to pull this off?
Is there a fast way to move files over a windows network?
Thanks so much for your help

With File.renameTo()? Yes.
between directories on different local drives? Yes.
or different nodes in a network?I'm not sure what you mean by that, which is most probably my lack of knowledge about computer networking.
Here's the test I performed:
File a = new File("C:/Temp/test.txt");
// 'E:' is (physicaly) a different hard drive than 'C:'
File b = new File("E:/Temp/test.txt");   
System.out.println(a.renameTo(b));
// 'Athene' is a home-SAN-drive/server connected to my router
File c = new File("//Athene/SHARE/Temp/test.txt");
System.out.println(b.renameTo(c));Both print true and in both cases I have checked to see if the files really were moved, which was the case.

Similar Messages

  • Unable to share files over the local network, OS X Lion

    About two weeks ago, my coworker and I realized that we were no longer able to share files over the local network. We have not made any changes to our preference settings. We are able to access FileMaker Pro databases files located on another computer in our office via the network, but we are unable to access any other files by trying to login to the computer remotely. We also have internet access. I am able to login to each of our work computers form home, but not from the office. I'm am not sure what has changed, but it is important that we have the ability to share files at work. Can you give me directions on how to fix our problem. Thanks!
    Debbie Roberts
    Univesrity of Texas at Austin

    I had this problem when I first setup my Mac. One thing I know is that File Sharing in System Preferences doesn't necessarily need to be on, because iTunes does all of the networking itself.
    I know that you've checked and checked again on the firewall, but what I did was turn the firewall on. In the list of ALLOW, there should be a line that is labeled iTunes Music Sharing. Check it. It was the magic link, and all of my iTunes libraries on the three computers in the house (two Windows, one my Mac) could "see" each other.
    Turning on the firewall might seem strange, but it worked for me.
    I hope this helps.
    MacBook Mac OS X (10.4.9)

  • Why i can't make a normal video call over my cellular operator using by iphone 4s ????!!!! is it possible that if my mobile is iphone so i can not contact (Video Call - or Send Files over Bluetooth ) people do not have iphone ??????!!!!!!!!!

    why i can't make a normal video call over my cellular operator using by iphone 4s ????!!!!
    is it possible that if my mobile is iphone so i can not contact (Video Call - or Send Files over Bluetooth ) people do not have iphone ??????!!!!!!!!!
    i'm still looking for solution, but if i there is no solution so i will throw My Own iPhone 4S in the nearest Trash.
    (I had got a big problem and thanks for Nokia saved me. and if i don't care about apple products i will never send to you this, so kindly find solution or people in middle east will stop using iphone)

    No clue why you cannot make video calls over your cellular operator... have you tried contacting them?
    If you're referring to FaceTime, it is currently limited to Wi-Fi only.
    Sending files via Bluetooth is not a supported feature of the iPhone or iOS.  A simple search of the web or these forums would have made that abundantly clear.
    Threatening to throw away valuable items in these forums only serves to make you look less than intelligent.  No one here is an Apple employee, we are all users like yourself.  As such, we could care less what you do.  If you choose to be stupid, that's up to you.
    Educate yourself and stop whining.

  • Sending Video over the wireless network

    I am considering capturing images from a IEEE 1394 camera and sending it over the Wireless network to another computer.  The reason we want to do that is to make the
    camera device light and portable by connecting it to a portable tablet computer.
    What kind of protocol is the best way to transfer the image. The TCP or UDP in labview convert data into string before the transmission which are very inefficient. I just want to streaming the raw image data, maybe with some protocol overhead.  Did National Instrument has any package to do that or any other software packages available?
    There might be another solution is to use the Ethernet cameras instead of 1394 cameras.
    Would it be possible for the Labview application on a remote desktop computer to acquire the Ethernet camera over a WiFi wireless connnetction in between ?
    Thanks
    Cindy

    Hello Cindy,
    If you want to transfer data across a
    network, TCP would be the most efficient method (wireless is typically not as
    successful as Ethernet due to the overhead).  There is actually a very useful knowledgebase
    document that discusses the various methods used to transfer image data across
    a network.  If you go to our main site http://www.ni.com and search using the keywords “Images
    Over Network”, the first link is entitled Streaming
    IMAQ Images Over a Network (or Internet) which gives brief descriptions if
    you choose to use TCP/IP, Datasocket, LabVIEW web server, or ActiveX.  Another very informative document results in
    that same search and is titled Transfer Images Over the Network
    which actually gives examples
    illustrating different ways to send images.  I hope this helps.  Please let us know if you would like further
    clarification or assistance regarding this issue.Vu D

  • Problem with Sending files over Sockets

    Hi. I have a problem when I try to send files over sockets. When I send text files it works well but when I try to send .jpg or other kind of files it doesn't work well because some characters are wrong, I hope you can help me.
    Here is my code:
    //Sender code
    import java.io.*;
    import java.net.*;
    class Servidor{
         Servidor(){
              try{
                   String arch="art.jpg";
                   ServerSocket serv=new ServerSocket(125);
                   Socket socket=serv.accept();
                   System.out.println("Conectado");
                   int c;
                   BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
                   FileInputStream fis=new FileInputStream(arch);
                   File f=new File(arch);
                   bw.write(""+f.length());
                   bw.newLine();
                   bw.flush();
                   System.out.println("Escribiendo");
                   while((c=fis.read())!=-1){
                        bw.write(c);
                   bw.flush();
                   fis.close();
                   System.out.println("Terminado");
                   while(true){
              }catch(Exception e){
                   System.out.println(e);
         public static void main(String arg[]){
              new Servidor();
    //Client code
    import java.io.*;
    import java.net.*;
    class Cliente{
         Cliente(){
              try{
                   Socket socket=new Socket("localhost",125);
                   System.out.println("Conectado");
                   BufferedReader br=new BufferedReader(new InputStreamReader(socket.getInputStream()));
                   long tam=Long.parseLong(br.readLine());
                   long act=0;
                   FileOutputStream fos=new FileOutputStream("resp.jpg");
                   System.out.println("Recibiendo: "+tam);
                   while(act<tam){
                        fos.write(br.read());
                        act++;
                   System.out.println("Terminado: "+act+" / "+tam);
                   fos.close();
              }catch(Exception e){
                   System.out.println(e);
         public static void main(String arg[]){
              new Cliente();
    }

    I don't think you want BufferedReader and OutputStreamWriter, you want ByteArrayOutputStream and ByteArrayInputStream . The problem is that you are sending jpegs (binary data) as text.

  • EFS Encrypted Files over home workgroup network via WebDAV avoiding Active Directory fixing Access Denied errors

    This is for information to help others
    KEYWORDS:
      - Sharing EFS encrypted files over a personal lan wlan wifi ap network
      - Access denied on create new file / new fold on encrypted EFS network file share remote mapped folder
      - transfer encryption keys / certificates
      - set trusted delegation for user + computer for EFS encrypted files via
    Kerberos
      - Windows Active Directory vs network file share
      - Setting up WinDAV server on Windows 7 Pro / Ultimate
    It has been a long painful road to discover this information.
    I hope sharing it helps you.
    Using EFS on Windows 7 pro / ultimate is easy and works great. See
    here and
    here
    So too is opening + editing encrypted files over a peer-to-peer Windows 7 network.
    HOWEVER, creating a new file / new folder over a peer-to-peer Windows 7 network
    won't work (unless you follow below steps).
    Typically, it is only discovered as an issue when a home user wants to use synchronisation software between their home computers which happens to have a few folders encrypted using windows EFS. I had this issue trying to use GoodSync.
    Typically an "Access Denied" error messages is thrown when a \\clientpc tries to create new folder / new file in an encrypted folder on a remote file share \\fileserver.
    Why such a EFS drama when a network is involved?
    Assume a home peer-to-peer network with 2pc:  \\fileserver  and  \\clientpc
    When a \\clientpc tries to create a new file or new folder on a \\fileserver (remote computer) it fails. In a terribly simplified explanation it is because the process on \\fileserver that is answering the network requests is a process working for a user on
    another machine (\\clientpc) and that \\fileserver process doesn't have access to an encryption certificate (as it isn't a user). Active Directory gets around this by using kerberos so the process can impersonate a \\fileserver user and then use their certificate
    (on behalf of the clienpc's data request).
    This behaviour is confusing, as a \\clientpc can open or edit an existing efs encrypted file or folder, just can't create a new file or folder. The reason editing + opening an encrypted file over a network file share is possible is because the encrypted
    file / folder already has an encryption certificate, so it is clear which certificate is required to open/edit the file. Creating a new file/folder requires a certificate to be assigned and a process doesn't have a profile or certificates assigned.
    Solutions
    There are two main approaches to solve this:
         1) SOLVE by setting up an Active Directory (efs files accessed through file shares)
              EFS operations occur on the computer storing the files.
              EFS files are decrypted then transmitted in plaintext to the client's computer
              This makes use of kerberos to impersonate a local user (and use their certificate for encrypt + decrypt)
         2) SOLVE by setting up WebDAV (efs files accessed through web folders)
               EFS operations occur on the client's local computer
               EFS files remain encrypted during transmission to the client's local computer where it is decrypted
               This avoids active directory domains, roaming or remote user profiles and having to be trusted for delegation.
               BUT it is a pain to set up, and most online WebDAV server setup sources are not for home peer-to-peer networks or contain details on how to setup WebDAV for EFS file provision
             READ BELOW as this does
    Create new encrypted file / folder on a network file share - via Active Directory
    It is easily possible to sort this out on a domain based (corporate) active directory network. It is well documented. See
    here. However, the problem is on a normal Windows 7 install (ie home peer-to-peer) to set up the server as part of an active directory domain is complicated, it is time consuming it is bulky, adds burden to operation of \\fileserver computer
    and adds network complexity, and is generally a pain for a home user. Don't. Use a WebDAV.
    Although this info is NOT for setting up EFS on an active directory domain [server],
    for those interested here is the gist:
    Use the Active Directory Users and Computers snap-in to configure delegation options for both users and computers. To trust a computer for delegation, open the computer’s Properties sheet and select Trusted for delegation. To allow a user
    account to be delegated, open the user’s Properties sheet. On the Account tab, under Account Options, clear the The account is sensitive and cannot be delegated check box. Do not select The account is trusted for delegation. This property is not used with
    EFS.
    NB: decrypted data is transmitted over the network in plaintext so reduce risk by enabling IP Security to use Encapsulating Security Payload (ESP)—which will encrypt transmitted data,
    Create new encrypted file / folder on a network file share - via WebDAV
    For home users it is possible to make it all work.
    Even better, the functionality is built into windows (pro + ultimate) so you don't need any external software and it doesn't cost anything. However, there are a few hotfixes you have to apply to make it work (see below).
    Setting up a wifi AP (for those less technical):
       a) START ... CMD
       b) type (no quotes): "netsh  wlan set hostednetwork mode=allow ssid=MyPersonalWifi key=12345 keyUsage=persistent"
       c) type (no quotes): "netsh  wlan start hostednetwork"
    Set up a WebDAV server on Windows 7 Pro / Ultimate
    -----ON THE FILESERVER------
       1  click START and type "Turn Windows Features On or Off" and open the link
           a) scroll down to "Internet Information Services" and expand it.
           b) put a tick in: "Web Management Tools" \ "IIS Management Console"
           c) put a tick in: "World Wide Web Services" \ "Common HTTP Features" \ "WebDAV Publishing"
           d) put a tick in: "World Wide Web Services" \ "Security" \ "Basic Authentication"
           e) put a tick in: "World Wide Web Services" \ "Security" \ "Windows Authentication"
           f) click ok
           g) run HOTFIX - ONLY if NOT running Windows 7 / windows 8
    KB892211 here ONLY for XP + Server 2003 (made in 2005)
    KB907306 here ONLY for Vista, XP, Server 2008, Server 2003 (made in 2007)
      2 Click START and type "Internet Information Services (IIS) Manager"
      3 in IIS, on the left under "connections" click your computer, then click "WebDAV Authoring Rules", then click "Open Feature"
           a) on the right side, under Actions, click "Enable WebDAV"
      4 in IIS, on the left under "connections" click your computer, then click "Authentication", then click "Open Feature"
           a) on the "Anonymous Authentication" and click "Disable"
           b) on the "Windows Authentication" and click "Enable"
          NB: Some Win 7 will not connect to a webDAV user using Basic Authentication.
            It can be by changing registry key:
               [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WebClient\Parameters]
               BasicAuthLevel=2
           c) on the "Windows Authentication" click "Advanced Settings"
               set Extended Protection to "Required"
           NB: Extended protection enhances the windows authentication with 2 security mechanisms to reduce "man in the middle" attacks
      5 in IIS, on the left under "connections" click your computer, then click "Authorization Rules", then click "Open Feature"
           a) on the right side, under Actions, click "Add Allow Rule"
           b) set this to "all users". This will control who can view the "Default Site" through a web browser
           NB: It is possible to specify a group (eg Administrators is popular) or a user account. However, if not set to "all users" this will require the specified group/user account to be used for logged in with on the
    clientpc.
           NB: Any user account specified here has to exist on the server. It has a bug in that it usernames specified here are not validated on input.
      6 in IIS, on the left under "connections" click your computer, then click "Directory Browsing", then click "Open Feature"
           a) on the right side, under Actions, click "Enable"
    HOTFIX - double escaping
      7 in IIS, on the left under "connections" click your computer, then click "Request Filtering", then click "Open Feature"
           a) on the right side, under Actions, click "Edit Feature Settings"
           b) tick the box "Allow double escaping"
         *THIS IS VERY IMPORTANT* if your filenames or foldernames contain characters like "+" or "&"
         These folders will appears blank with no subdirectories, or these files will not be readable unless this is ticked
         This is safe btw. Unchecked (default) it filters out requests that might possibly be misinterpreted by buggy code (eg double decode or build url's via string-concat without proper encoding). But any bug would need to be in IIS basic
    file serving and this has been rigorously tested by microsoft, so very unlikely. Its safe to "Allow double escaping".
      8 in IIS, on the left under "connections" right click "Default Web Site", then click "Add Virtual Directory"
           a) set the Alias to something sensible eg "D_Drive", set the physical path
           b) it is essential you click "connect as" and set
    this to a local user (on fileserver),
           if left as "pass through authentication" a client won't be able to create a new file or folder in an encrypted efs folder (on fileserver)
                 NB: the user account selected here must have the required EFS certificates installed.
                            See
    here and
    here
            NB: Sharing the root of a drive as an active directory (eg D:\ as "D_Drive") often can't be opened on clientpcs.
          This is due to windows setting all drive roots as hidden "administrative shares". Grrr.
           The work around is on the \\fileserver create an NTFS symbollic link
              e.g. to share the entire contents of "D:\",
                    on fileserver browse to site path (iis default this to c:\inetpub\wwwroot)
                    in cmd in this folder create an NTFS symbolic link to "D:\"
                    so in cmd type "cd c:\inetpub\wwwroot"
                    then in cmd type "mklink /D D_Drive D:\"
            NB: WebDAV will open this using a \\fileserver local user account, so double check local NTFS permissions for the local account (clients will login using)
             NB: If clientpc can see files but gets error on opening them, on clientpc click START, type "Manage Network Passwords", delete any "windows credentials" for the fileserver being used, restart
    clientpc
      9 in IIS, on the left under "connections" click on "WebDAV Authoring Rules", then click "Open Feature"
           a) click "Add authoring rules". Control access to this folder by selecting "all users" or "specified groups" or "specified users", then control whether they can read/write/source
           b) if some exist review existing allow or deny.
               Take care to not only review the "allow access to" settings
               but also review "permissions" (read/write/source)
           NB: this can be set here for all added virtual directories, or can be set under each virtual directory
      10 Open your firewall software and/or your router. Make an exception for port 80 and 443
           a) In Windows Firewall with Advanced Security click Inbound Rules, click New Rule
                 choose Port, enter "80, 443" (no speech marks), follow through to completion. Repeat for outbound.
              NB: take care over your choice to untick "Public", this can cause issues if no gateway is specified on the network (ie computer-to-computer with no router). See "Other problems+fixes"
    below, specifically "Cant find server due to network location"
           b) Repeat firewall exceptions on each client computer you expect to access the webDAV web folders on
    HOTFIX - MAJOR ISSUE - fix KB959439
      11 To fully understand this read "WebDAV HOTFIX: RAW DATA TRANSFERS" below
          a) On Windows 7 you need only change one tiny registry value:
               - click START, type "regedit", open link
               -browse to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MRxDAV\Parameters]
               -on the EDIT menu click NEW, then click DWORD Value
               -Type "DisableEFSOnWebDav" to name it (no speech marks)
               -on the EDIT menu, click MODIFY, type 1, then click OK 
               -You MUST now restart this computer for the registry change to take effect.
          b) On Windows Server 2008 / Vista / XP you'll FIRST need to
    download Windows6.0-KB959439 here. Then do the above step.
             NB microsoft will ask for your email. They don't care about licence key legality, it is more to keep you updated if they modify that hotfix
      12 To test on local machine (eg \\fileserver) and deliberately bypass the firewall.
            a) make sure WebClient Service is running
                (click START, type "services" and open, scroll down to WebClient and check its status)
            b) Open your internet software. Go to address "http://localhost:80" or "http://localhost:80"
                It should show the default "IIS7" image.
                If not, as firewall and port blocking are bypassed (using localhost) it must be a webDAV server setting. Check "Authorization Rules" are set to "Allow All Users"           
            c) for one of the "virtual directories" you added (8), add its "alias" onto "http://localhost/"
                    e.g. http://localhost/D_drive
                If nothing is listed, check "Directory Browsing" is enabled
      13 To test on local machine or a networked client and deliberately try and access through the firewall or port opening of your router.
            a) make sure WebClient Service is running
                (click START, type "services" and open, scroll down to WebClient and check its status)
            b) open your internet software. Go to address "http://<computer>:80" or "http://<computer>:80".
                  eg if your server's computer name is "fileserver" go to "http://fileserver:80"
                  It should show the default "IIS7" image. If not, check firewall and port blocking. 
                  Any issue ie if (12) works but (13) doesn't,  will indicate a possible firewall issue or router port blocking issue.
           c) for one of the "virtual directories" you added (8), add its "alias" onto "http://<computername>:80/"
                   eg if alias is "C_driver" and your server's computer name is "fileserver" go to "http://fileserver:80/C_drive"
                   A directory listing of files should appear.
    --- ON EACH CLIENT ----
    HOTFIX - improve upload + download speeds
      14 Click START and type "Internet Options" and open the link
            a) click the "Connections" tab at the top
            b) click the "LAN Settings" button at the bottom right
            c) untick "Automatically detect settings"
    HOTFIX - remove 50mb file limit
      15 On Windows 7 you need only change one tiny registry value:
          a) click START, type "regedit", open link
          b) browse to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WebClient\Parameters]
           c) click on "FileSizeLimitInBytes"
           d) on the EDIT menu, click MODIFY, type "ffffffff", then click OK (no quotes)
    HOTFIX - remove prompt for user+pass on opening an office or pdf document via WebDAV
     16 On each clientpc click START, type "Internet Options" and open it
             a) click on "Security" (top) and then "Custom level" (bottom)
             b) scroll right to the bottom and under "User Authentication" select "Automatic logon with current username and password"
             SUCH an easy fix. SUCH an annoying problem on a clientpc
       NB: this is only an issue if the file is opened through windows explorer. If opened through the "open" dialogue of the software itself, it doesn't happen. This is as a WebDAV mapped drive is consdered a "web folder" by windows
    explorer.
    TEST SETUP
      17 On the client use the normal "map network drive"
                e.g. server= "http://fileserver:80/C_drive", tick reconnect at logon
                e.g. CMD: net use * "http://fileserver:80/C_drive"
             If it doens't work check "WebDAV Authoring Rules" and check NTFS permissions for these folders. Check that on the filserver the elected impersonation user that the client is logging in with (clientpc
    "manage network passwords") has NTFS permissions.
      18 Test that EFS is now working over the network
           a) On a clientpc, map network drive to http://fileserver/
           b) navigate to a folder you know on the \\flieserver is encrypted with EFS
           c) create a new folder, create a new file.
               IF it throws an error, check carefully you mapped to the WebDAV and not file share
                  i.e. mapped to "http://fileserver" not "\\fileserver"
               Check that on clientpc the required efs certificate is installed. Then check carefully on clientpc what user account you specified during the map drive process. Then check on the \\fileserver this
    account exists and has the required EFS certificate installed for use. If necessary, on clientpc click START, type "Manage Network Passwords" and delete the windows credentials currently in the vault.
           d) on clientpc (through a webDAV mapped folder) open an encrypted file, edit it, save it, close it. On the \\fileserver now check that file is readable and not gobble-de-goup
           e) on clientpc copy an encrypted efs file into a folder (a webDAV mapped folder) you know is not encrypted on \\fileserver. Now check on the \\fileserver computer that the file is readable and not gobble-de-goup (ie the
    clientpc decrypted it then copied it).
            If this fails, it is likely one in IIS setting on fileserver one of the shared virtual directories is set to: "pass through authentication" when it should be set to "connect as"
            If this is not readable check step (11) and that you restarted the \\fileserver computer.
      19 Test that clients don't get the VERY annoying prompt when opening an Office or PDF doc
          a) on clientpc in windows explorer browse to a mapped folder you know is encrypted and open an office file and then PDF.
                If a prompt for user+pass then check hotfix (16)
      20 Consider setting up a recycling bin for this mapped drive, so files are sent to recycling bin not permanently deleted
          a) see the last comment at the very bottom of
    this page: 
    Points to consider:
       - NB: WebDAV runs on \\fileserver under a local user account, so double check local NTFS permissions for that local account and adjust file permissions accordingly. If the local account doesn't have permission, the webDAV / web folder share won't
    either.
      - CONSIDER: IP Security (IPSec) or Secure Sockets Layer (SSL) to protect files during transport.
    MORE INFO: HOTFIX: RAW DATA TRANSFERS
    More info on step (11) above.
    Because files remain encrypted during the file transfer and are decrypted by EFS locally, both uploads to and downloads from Web folders are raw data transfers. This is an advantage as if data is intercepted it is useless. This is a massive disadvantage as
    it can cause unexpected results. IT MUST BE FIXED or you could be in deep deep water!
    Consider using \\clientpc to access a webfolder on \\fileserver and copying an encrypted EFS file (over the network) to a web folder on \\fileserver that is not encrypted.
    Doing this locally would automatically decrypt the file first then copy the decrypted file to the non-encrypted folder.
    Doing this over the network to a web folder will copy the raw data, ie skip the decryption stage and result in the encrypted EFS file being raw copied to the non-encrypted folder. When viewed locally this file will not be recognised as encrypted (no encryption
    file flag, not green in windows explorer) but it will be un-readable as its contents are still encrypted. It is now not possible to locally read this file. It can only be viewed on the \\clientpc
    There is a fix:
          It is implimented above, see (11) above
          Microsoft's support page on this is excellent and short. Read "problem description" of "this microsoft webpage"
    Other problems + fixes
      PROBLEM: Can't find server due to network location.
         This one took me a long time to track down to "network location".
         Win 7 uses network locations "Home" / "Work" / "Public".
         If no gateway is specified in the IP address, the network is set to '"unidentified" and so receives "Public" settings.
         This is a disaster for remote file share access as typically "network discovery" and "file sharing" are disabled under "Public"
         FIX = either set IP address manually and specify a gateway
         FIX = or  force "unidentified" network locations to assume "home" or "work" settings -
    read here or
    here
         FIX = or  change the "Public" "advanced network settings" to turn on "network discovery" and "file sharing" and "Password Protected Sharing". This is safe as it will require a windows
    login to gain file access.
      PROBLEM: Deleting files on network drive permanently deletes them, there is no recycling bin
           By changing the location of "My Contacts" or similar to the root directory of your mapped drive, it will be added to recycling bin locations
          Read
    here (i've posted a batch script to automatically make the required reg files)
    I really hope this helps people. I hope the keywords + long title give it the best chance of being picked up in web searches.

    What probably happens is that processes are using those mounts. And that those processes are not killed before the mounts are unmounted. Is there anything that uses those mounts?

  • Sending File Over Serial PORT

    Hi,
    I'm able to read/write data over serial port using Java Comm APIs in Linux.
    Can anybody please tell me how to write/read a file over Serial port?
    Is it similar to sending a file over network?
    An early response is appreciated...

    Same stream I/O as used over the port works from a file. Dead simple.
    Also dead slow. If you want to do large amounts of data, use a RandomAccessFile and read a big chunk at a time into a byte array. Then send the byte array.

  • Search for files over a mapped network drive

    Hi,
    At the moment I'm using a simple listFiles with a FileFilter to do a search over a mapped network drive. But the performance is not very good.
    The number of folders and files that need to be searched is rather high, resulting in long waiting times (+5min).
    Is there a way to improve this type of searches?
    Thanks in advance,
    Dave

    Hard to say without seeing details. Try to narrow down where it happens.
    One nasty bug in Windows (let's assume you are using it) is that stat'ing all files in a directory is much faster than stat'ing them individually. In other words, if you do something like
        String names[] = directory.list();
        for (name in names) {
            File f = new File(name);
            if (f.isDirectory()) ...
        }that's way slower than:
        File files[] = directory.listFiles();
        for (f in files) {
            if (f.isDirectory()) ...
        }See if you do "new File()" for all files, e.g. in your filter. It will kill your performance. To demonstrate: open a big directory in standard Windows file explorer. Select all files. Right-click & select Properties. Go for lunch while Windows thinks about it. Compare with performance of clicking Properties for the directory instead of a collection of all the files.

  • How can i send file over messages in Mac OS X?

    Hi,
    Unable to send files from messages application in my Mac, i configured gmail account in messages so u can able to chat with my friends but i can't send any file to my friends. so is there any setting needs to be configure in preferences? please suggest me.
    Thanks in Advance,
    Suresh Balakrishnan.

    HI,
    In iChat 6 before you upgraded to Messages Beta were you able to Send Files ?
    There are also various ways to start this
    Try:-
    Dropping a file on a Buddy's name in the Buddy List
    Dragging a File to the text entry field in a chat.
    In a Video Chat drag a file over the Chat window and chose the half that says  Send File.
    As it is Google are you Buddies logged in via the Web Browser or a Jabber App or iChat on a Mac ?
    9:16 PM      Wednesday; March 28, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Need to search contents of text files on a windows network drive....

    I am trying to search the content of a directory on a windows network drive for that contains .sas files (essentially text files) for a certain text string. Find does not seem to do this. Any ideas/suggestions?
    When I copy a file to my desktop I can do it easily, but that is not an option.

    Uh yeah....in my opinion GREATLY affects Apple's claim to windows compatibility......unless there is a solution out there. My firm is windows-based and we have a terabyte or so of data and files related to various stuff all buried in subfolders..and all I want is to search one folder for one text string.
    I'm praying for a solution here.....

  • Additional question: Can you share files on a Windows Network?

    Is it possible to share your files on an iPad across my Windows network?

    Like other's have mentioned, Dropbox will let you download files to your Dropbox account on your computer (just go to dropbox.com to download to your computer for free) and then from the Dropbox app (free in the App Store), you can access them.  Works fine for me.  They give you a free box with limited storage.  If you want more storage, you can of course buy more........

  • Using Flyer to send files over a Bluetooth connection

    import mx.utils.Delegate;
    import com.flyer.Bluetooth;
    var connection_str:String = “127.0.0.1″;
    var port_num:Number = 9100;
    var connection_bt:Bluetooth = new Bluetooth();
    var filePath_str:String = “E:\\photo_001.png”;
    function sendFile():Void {
    connection_bt.connect(connection_str, port_num);
    status_txt.text = “Connecting to Python…”;
    function onBluetoothConnect(success_bool:Boolean):Void {
    if (success_bool) {
    status_txt.text = “Sending file…”;
    connection_bt.send(”sendFile” + “|”
    + filePath_str);
    } else {
    status_txt.text = “Connection failed.”;
    function onBluetoothData(source_str:String):Void {
    status_txt.text = source_str;
    function onBluetoothClose():Void {}
    connection_bt.onData = Delegate.create(this,
    onBluetoothData);
    connection_bt.onConnect = Delegate.create(this,
    onBluetoothConnect);
    connection_bt.onClose = Delegate.create(this,
    onBluetoothClose);
    sendFile()

    is is possible to use a filestream to send files from
    client to server? If so could someone show me some
    example code or point me to a good internet
    reference. i have done some searching and reading
    but haven't found anything that showed it well.
    thanks for the help in advance.The API descriptions for the 2 filestream classes gives the answer:
    FileInputStream - A FileInputStream obtains input bytes from a file in a file system.
    FileOutputStream - A file output stream is an output stream for writing data to a File or to a FileDescriptor.

  • Trouble sending files over the network.

    I have a network application that corrupts any files that it sends, although the received file is very close (but never exact) to the number of bytes it should be. There is a socket client that each client has, and the Packet data structure is searializable and simply contains a string message and the byte[]. Am I doing something wrong?
    Here is my code for Sending:
    ObjectOutputStream toOtherClient = new ObjectOutputStream(client.getOutputStream());
    ObjectInputStream fromOtherClient = new ObjectInputStream(client.getInputStream());
    Packet fileRequest = (Packet)fromOtherClient.readObject();
    File file = new File(DefaultConfig.defaultFileDirectory+"\\"+fileRequest.getMessage());
    FileInputStream fromDisk = new FileInputStream(file);
    BufferedInputStream fromDiskBuffered = new BufferedInputStream(fromDisk);
    byte[] buffer = new byte[maxPayload];
    while(fromDiskBuffered.available() > 0)
         if (fromDisk.available() > maxPayload)
              fromDiskBuffered.read(buffer);
              toOtherClient.writeObject(new Packet(Packet.Command.File,"",buffer));
         else
              buffer = new byte[fromDiskBuffered.available()];
              fromDiskBuffered.read(buffer);
              toOtherClient.writeObject(new Packet(Packet.Command.File,"",buffer));
    fromDiskBuffered.close();
    fromDisk.close();
    toOtherClient.writeObject(new Packet(Packet.Command.File,"ack"));
    fromOtherClient.close();
    toOtherClient.close();
    client.close();Here is my code for recieving:
    Socket client = new Socket(host, Integer.parseInt(port));
    ObjectOutputStream toOtherClient = new ObjectOutputStream(client.getOutputStream());
    ObjectInputStream fromOtherClient = new ObjectInputStream(client.getInputStream());
    FileOutputStream toDisk = new FileOutputStream(DefaultConfig.defaultFileDirectory+"//"+whatFile); BufferedOutputStream toDiskBuffered = new BufferedOutputStream(toDisk);
    toOtherClient.writeObject(new Packet(Packet.Command.File,whatFile));
    Packet incoming;
    while(true)
         incoming = (Packet)fromOtherClient.readObject();
         if (incoming.getMessage().equals("ack"))
              break;
         byte[] fileData = (byte[])incoming.getData();
         toDiskBuffered.write(fileData);
    toDiskBuffered.flush();
    toDiskBuffered.close();
    toDisk.close();
    fromOtherClient.close();
    toOtherClient.close();
    client.close();

    You're assuming that available() gives you the total length of the file, which it doesn't, and you're ignoring the result returned by the read call, so you're assuming you've read data you may not have read.
    I would rethink the tactic of reading the entire file into a single buffer - this doesn't scale. It's only safe if you know that the file size has an upper bound and that this is relatively low.

  • Sharing printers and files in a windows network with Mac OS 9.1

    We've just installed an old iMac with Mac OS 9.1 in the office.The network is made up of 2 windows PCs and this new iMac, connected through a D-link wireless router. We have a USB printer connected to one of the PC's and it's shared by the rest.
    Anyway, I have very little experience with Mac OS and I want the iMac to use the printer as well as share files with the other PCs. Could anyone help me with a "foolproof" guide on how to do this? Thanks

    Followup:
    indeed, 10.6 uses ntfs streams when availible to store metadata.
    for a workaround:
    http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/m an5/nsmb.conf.5.html
    create
    /etc/nsmb.conf
    contents:
    \[default\]
    streams=no
    close all server connections, reconnect.
    Message was edited by: nobody loopback

  • Mac corrupts file names on Windows network

    I am using my MacBook with Tiger on a Windows peer-to-peer network. Works fine, except occasionally files names that I access on one of the Windows machines will become confused. It's occurrence seems random to me; I think it only happens when I save changes, though. So, for instance, the file OnlineAccountInformation.xls would become OnlineAcco%32hg.xls. Any idea what might be causing this? I had the same problem with Panther.

    well ther eis a 32 char limit for a file name .and an 80-something limit for the total path i think. Usually though i get an error message that just says so much or simply that an erro occured and the file couldnt be saved. Also if you have a super long name that youve saved on the windows machine youll usually get the DOS name of the file when browsing from a mac.

Maybe you are looking for

  • Error while generating remuneration statement

    Hi I found an error, while generating remuneration statement. The error is "Start date 01.01.1800 is higher than end date 00.00.0000". Kindly help Shadeesh

  • File sharing using skype

    Dear All When i click on a file in my macbook air under the share option Skype is not getting listed. I have even tried going to more but still Skype is not listed there also. Can anyone help me out in this? Rgds Shanker

  • Reuse of PAPI -WS WSDL URL

    Hi, Can we resue web-services created via. Java PAPI or PAPI - WS in one process for other processes without changing anything? Can we take that WSDL and create a client and create instances inside another process using that WSDL ?

  • Trying to download through Creative Cloud

    When I go to the Creative Cloud website to download Premiere Pro CC, it isn't showing up as an app that is downloadable through my creative cloud team membership.

  • Disk Nearly Full...Why? And How Do I Correct?

    Hello all, I tried burning a 25 minute iDVD last night and received a burning prep error. I found out yes, my memory is extremely low. I've been following different threads to try and fix but to be honest, some of the solutions are too high-tech for