File Copy/Path Names

I have the following code (class and other left out):
File inputFile = new File("C:\\Temp\\javacopy.txt");
File outputFile = new File("A Different Server on Nework\\javacopy.txt");
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;
while ((c = in.read()) != -1)
out.write(c);
in.close();
out.close();
My question is how do I refernce the Windows server on the Network for the output?
Example: \\MyServer\F:\Temp\

I was using: \\MyServer\\F:\\Temp\\javacopy.txt
I realized that Temp was a shared folder on the server and that I was not escaping the server. The following worked for me:
\\\\MyServer\\Temp\\javacopy.txt
Thanks.
p.s. Does it have to reference a sharename? I have tried the following and it does not work:
\\\\MyServer\\F:\\Temp1\\javacopy.txt (Where Temp1 is not shared)
Just wondering.

Similar Messages

  • Long file and path names

    I have a dialog window where users can choose a file, the name and path of which is then displayed. The field where this is displayed isn't big enough to hold the typical long path names found on for example Windows. I was wondering if there is a standardized way of shortening/abbreviating the full path name already written up somewhere? I want my program to be portable ... I looked at how MS Word does it on Windows, and I could write a specialized function to copy that, but then it wouldn't work on other systems that use different path conventions, and I would like to keep the generality if possible. On word they do something like this
    C:/.../final directory/filename

    Kramis wrote:
    sure, that much I understand, but I wouldn't know how to create that sort of string from an arbitrary path name of unknown format. In Windows, for example, I could take the first three characters and then ..., but that might not work globally. The questions is about parsing and converting a path name from an arbitrary system.I'd just split the path into its 'final directory name' and 'file name' (with the universal Java path seperator of (/)), and stick '...' in front of it.
    So any path such as C:/blah/blah/blah/endpath/filename or /unix/path/blah/blah/endpath/filename would become .../endpath/filename regardless of platform.

  • Obnoxious file and path names (help!)

    How can I construct a regular site, that doesn't involve having my file names being danscool_website.html and having the url name in each file. I hate it.

    It would be better to tell people what it is you do want, perhaps with an example.
    If you want your file names to be different than the page and site names you yourself set in the Inspector, then you would need to edit the html by hand each time after publishing. If this is really important to you, it may be best to use another web creation app which gives you that option.
    I'm not sure what you mean by "having the url name in each file". I've seen some people inflict ugly path names on themselves by naming their site inside the iWeb app the same as their personal domain name. The fix for that is to name the site something short and simple like "1" instead.
    If you can provide your url or be more specific, more ideas may be fortcoming.

  • I want to *use* very long file and path names!

    This is really a plea to Microsoft...
    There are several threads about copying or deleting files where the path and/or file name is too long.
    Most have explanations of why this problem occurs.  (depending on Windows version and application, the total length [fully qualified file name; i.e. C:\this-dir\that-dir\somefile.xyz] is limited to a maximum of 260 or fewer characters).  This limit
    But I *WANT* to be able to use very long file names and paths!
    I can understand Microsoft keeping this limit - even while allowing UNICODE paths and file names up to 32k characters - because many existing tools will be unable to handle the longer names.  This would probably yield a lot of questions/flames about
    them "breaking the software I've used for years."
    But it would be possible to have a system setting to optionally allow the long names.  Since I'd have to manually set it, I'd know I'm potentially breaking existing software.
    In my case, I'm backing up various file directories where some files are very long.  With the server-side additional paths (e.g., client-name\project-name\backup-date\...") I occasionally hit files that can't be copied.  Renaming is not suitable;
    sometimes names have to match other file names.
    I can zip them, create iso files, use a backup program that creates a blob, put them in a source-control system, etc - but I really don't *want* to do that; it's very convenient to have a direct copy of the directories.  Each of these 'solutions' either
    requires extra work (which could be scripted, so ok...) or doesn't work with the work-flow for some reason.
    Microsoft, *please* fix this in Windows 8!  (if not before...)   This limit has existed for far too long!
    And readers - please don't just repeat what's in the other threads (rename/use subst/map directory/etc) or flame without useful information.  Thanks!

    Hi,
    I would submit your opinion to our Product Team. If you have another feedback, please feel free and let me know. Or you could follow TekDozer’s advice to submit
    by yourself.
    Thank you for your understanding and cooperation.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • Unicode file and path names...

    How does SleepyCat handle Unicode file names and directory paths?
    Are there any coding examples?
    Thanks

    We have support for Unicode using UTF-8 encodings.
    What platform(s) do your applications need to run on? Would Windows support for UTF-8 be sufficient?
    Related information:
    DB_ENV->open: http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/env_open.html
    DB->open: http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/db_open.html
    "When using a Unicode build on Windows (the default), the db_home argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters."
    "When using a Unicode build on Windows (the default), the file argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters."
    Bogdan Coman

  • Listing Files Without Path Name?

    Well this is about the only way I could figure out how to get the file names contained with in this path.
         public String[] getFileName(File path){
             File files[];
             files = path.listFiles();
             Arrays.sort(files);
             String data[] = new String[files.length];
             for (int i = 0, n = files.length; i < n; i++) {
              data[i] = files.toString();
              return data;

    public String[] getFileName(File path){
             File files[];
             files = path.listFiles();
             Arrays.sort(files);
             String data[] = new String[files.length];
             for (int i = 0, n = files.length; i < n; i++) {
              data[i] = files.getName(); // instead of toString()
              return data;
    Edited by: Metko on Mar 31, 2008 6:48 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Automatic name changes and file and path name limitation when storing files

    Dear all I am using Airport Extrem with an attached disc and experience following:
    1) Names get changed. Second part of file name gets replaced with some hex numbering
    2) Get the error message from time to time that file can't be stored on the Airport Extrem attached disc and that the file name is too long.
    Any idea.

    I've got the same problem with seagate 750 GB drive - Mac OS Extended (Journaled) - over fast ethernet (first gen) AEBS(n)
    P.S.- sometimes the folder names get corrected automaticaly, and sometimes folders get duplicated (with different corrupted hex-like name endings) and if I delete one of them, they all vanishes.
    Message was edited by: gar_krol

  • File copy from shell using nautilus file operations?

    Is it possible to have the nautilus file operations copy command from a shell?  In other words, rather than using the cp command, I'd like to have a file copy triggered from a bash script that uses the familiar "File Operations" dialog box in nautilus.  Can this be done?

    Hello Bibin,
    Give this a try., if i understood correctly. I coudn't test it my side.
    $servers = get-content C:\hosts.txt
    foreach ($server in $servers)
    if(test-path \\Centralserver\share\$server)
    if(test-path \\$server\c$\xxx.file)
    Copy -path \\$server\c$\xxx.file -Destination \\CentralServer\share\$server\ -Recurse -ErrorVariable CopyErrorS
    #stores all your copy errors
    $copyError = $copyError + $copyerrorS
    else
    Write-Output "source file on server $server is missing"
    else
    New-Item -Name $server -ItemType Directory -path \\centralserver\share\ -Force -Errorvariabe FCreationErrorS
    #Stores all your Folder creation errors
    $FCreationError = $FCreationError + $FCreationErrorS
    if((test-path \\$server\c$\xxx.file) -and (test-path \\Centralserver\share\$server))
    Copy -path \\$server\c$\xxx.file -Destination \\CentralServer\share\$server\ -Recurse -force
    else
    Write-Output "Error creating source folder on $server."
    Regards,
    V.
    Venu

  • /etc/oratab (a file or directory in the path name does not exists)

    Hello All,
    I ma trying to create a database oracle 11g R2 on AIX 6.1.
    But i am facing the below error at the beginning of the installation:
    /etc/oratab (a file or directory in the path name does not exists)
    Your help pls..

    When I am trying to run root.sh. it gives the below error:
    IST76SIT:/apps/oracle/oracle11/app/product/11.2.0/db1> ./root.sh
    Running Oracle 11g root.sh script...
    The following environment variables are set as:
    ORACLE_OWNER= oracle11
    ORACLE_HOME= /apps/oracle/oracle11/app/product/11.2.0/db1
    Enter the full pathname of the local bin directory: [usr/local/bin]: /usr/local/bin
    Creating /usr/local/bin directory...
    Copying dbhome to /usr/local/bin ...
    Copying oraenv to /usr/local/bin ...
    Copying coraenv to /usr/local/bin ...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    Finished product-specific root actions.
    ./root.sh[14]: /apps/oracle/oracle11/app/product/11.2.0/db1/rdbms/install/rootadd_rdbms.sh: not found.
    ./root.sh[16]: /apps/oracle/oracle11/app/product/11.2.0/db1/rdbms/install/rootadd_filemap.sh: not found.
    IST76SIT:/apps/oracle/oracle11/app/product/11.2.0/db1>

  • Logical file name or logical path name incorrectly defined

    Dear All,
    We are doing archival in our IDES for test purpose before we do it to our Production.
    Steps Performed
    Copied AM_ASSET archive object to ZAM_ASSET
    Logical Path
      Logical path    ZAM_ASSET
      Name            Asset
      Syntax group    UNIX       Unix compatible
      Physical path   /archive/test/<FILENAME>
    Logical File Name
       Logical file    ZAMASSET
       Name            Asset
       Physical file   FI_<MONTH>_<DAY>.txt
       Data format     ASC
       Applicat.area   AM
       Logical path    ZAM_ASSET
    But when we run the WRITE though SARA , in the job log we get the following
    Logical file name or logical path name incorrectly defined
    When generating a file name for an archive file that is to be created, the system determined that the logical file name FIAA_ARCHIVE_DATA_FILE or the logical path name ARCHIVE_GLOBAL_PATH  was defined incorrectly.
    But we have maintained a Logical name  ZAMASSET , so we are unable to change the location of archived file and as well as the format.
    So is there any setting we need to maintain apart from the logical file name and logical file path.
    Suggestions are highly appreciated.
    Thanks in anticipation

    hi,
    follow this steps :
    - transaction SARA
    - enter authorization objects, eg SD_VBAK
    - hit button CUSTOMIZING
    - Archiving Object-Specific Customizing: execute Technical Setting
    - field Logical File Name enter or select ARCHIVE_DATA_FILE
    - leave CONTENT REPOSITORY as blank if you are not using 3rd party for storing (eg. IBM Tivoli)
    - back to customizing
    - from Basis Customizing, execute : Cross-Client File Names/Paths
    - on Logical FIle Path Definition, highlight (select) ARCHIVE_GLOBAL_PATH on the right pane
    - double click on the Assignment of Physical Paths to Logical Path on the left pane
    - double click on OS used, eg. UNIX, define Physical Path where archive file (on WRITE process) will be stored
    - save changes made
    - double click Logical File Definition, Cross Client on the left pane
    - double click ARCHIVE_DATA_FILE on the right pane
    - make sure that logical path is already set to ARCHIVE_GLOBAL_PATH
    - save changes made
    this setting also can be done using transaction FILE
    we have experienced on this case using SAP standard archiving (SARA, SARI) and everything is fine with this setting above.
    hope it help you.
    rgds,
    Alfonsus Guritno

  • Copy, count files, test path, process indicator and System.IO.FileInfo

    I found this, sctipt, that I try to re-write.
    As it is, it creates sub folders in the targetfolder, which I found out how to stop it from, by deleting the "\" backslash sign in line 9.
    But what I also want is that subfolders if such should exist, also gets copied from $source to $target folder, as of now this doesn't happen. Reason why I chose to try to re-write the script is basically, I can read what it does and I like all the flashy
    Things like counting and that it shows the percentage of the processbar AND the processbar :).
    I just don't now how to re-write it proberly. By the way nothing should be re-named in the targetfolder every thing from sourcefolder should be "as is" in the sourcefolder.
    $SourceFolder = "C:\Color1\TRID"
    $targetFolder = “C:\Color2\TRID”
    $numFiles = (Get-ChildItem -Path $SourceFolder -Filter *.*).Count
    $i=0
    clear-host;
    Write-Host ‘This script will copy ‘ $numFiles ‘ files from ‘ $SourceFolder ‘ to ‘ $targetFolder
    Read-host -prompt ‘Press enter to start copying the files’
    Get-ChildItem -Path $SourceFolder -Filter *.* | %{
    [System.IO.FileInfo]$destination = (Join-Path -Path $targetFolder -ChildPath $_.Name.replace(“_”,“\”))
    if(!(Test-Path -Path $destination.Directory ))
    New-item -Path $destination.Directory.FullName -ItemType Directory
    [int]$percent = $i / $numFiles * 100
    copy-item -Path $_.FullName -Destination $Destination.FullName
    write-Progress -Activity “Copying … ($percent %)” -status $_ -PercentComplete $percent -verbose
    $i++
    Write-Host ‘Total number of files read from directory ‘$SourceFolder ‘ is ‘ $numFiles
    Write-Host ‘Total number of files that was copied to ‘$targetFolder ‘ is ‘ $i
    Read-host -prompt “Press enter to complete…”
    clear-host;

    @Jaap
    Yes I want to overwrite existing files, since backup is taken care of by another script.
    Now I encounter this error when trying to use your write-progress example:
    Get-ChildItem : A parameter cannot be found that matches parameter name 'Files'.
    At line:3 char:51
    + $Files = Get-ChildItem -LiteralPath $SourceFolder -Files
    +                                                  
    ~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
        + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
    cmdlet ForEach-Object at command pipeline position 1
    Supply values for the following parameters:
    Process[0]:
    Here is the script as I thought it should look like:
    $SourceFolder = "C:\Color1\TRID"
    $targetFolder = “C:\Color2”
    $Files = Get-ChildItem -LiteralPath $SourceFolder -Files
    $NumberofFiles = $Files.Count
    $Files | ForEach-Object -Begin {
    $FilesCopied = 0
    -progress{
    Write-Progress -Activity "Copying Files..." -PercentComplete [int](($FilesCopied/$NumberofFiles)*100) -CurrentOperation "$FilesCopied files copied out of total of $NumberofFiles files" -Status "Please wait."
    "$((Get-ChildItem -Recurse -File -LiteralPath $SourceFolder).Count) files will be copied to $targetfolder"
    Read-Host -Prompt 'Press Enter to Start Copying...'
    Copy-Item $SourceFolder -Recurse -Destination $targetFolder -Force -verbose
    $FilesCopied++
    # What is wrong now?

  • How can I paste the full path name into the find file dialog?

    I've copied a full path name using CMD-C.
    Now I click on a link in some web page (does not matter which one) which lets me upload a file.
    The standard apple file selector dialog pops up (sorry don't know the official apple name for this dialog), to let me navigate and select the file.
    How can I paste the file name?  Or how can I tell the dialog popup to navigate to the file whose full path name is in the clipboard?

    Here is an image showing the file browser dialog I'm referring to.

  • Bursting Problem - A file or directory in the path name does not exist

    I'm trying to burst some data via email using the standard DocumentProcessor java code but receiving an error relating, I assume, to an invalid temporary directory. I've checked that the directory exists, as do the data file and control file. By the way I am not running in Apps, just stand alone mode. Any ideas would be much appreciated.
    [042308_104249440][oracle.apps.xdo.batch.bursting.FileHandler][EXCEPTION] java.io.FileNotFoundException: /u02/DIAS/bursting/BIPublisher/tmp/042308_104249338/xdo2.tmp (A file or directory in the path name does not exist.)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:205)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:96)
    at oracle.apps.xdo.template.RTFProcessor.setOutput(Unknown Source)
    at oracle.apps.xdo.batch.bursting.FileHandler.rtf2xsl(Unknown Source)
    at oracle.apps.xdo.batch.bursting.ProcessDocument.getXSLFile(Unknown Source)
    at oracle.apps.xdo.batch.bursting.ProcessDocument.processTemplate(Unknown Source)
    at oracle.apps.xdo.batch.bursting.ProcessCoreDocument.processLayout(Unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.addDocument2Queue(Unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.createBurstingDocument(Unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.burstDocument(Unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.globalDataEndElement(Unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(Unknown Source)
    at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingRequest(Unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingEndElement(Unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(Unknown Source)
    at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingConfigParser(Unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.process(Unknown Source)
    at oracle.apps.xdo.batch.DocumentProcessor.process(Unknown Source)
    at PIreportburst.bEngine(PIreportburst.java:24)
    at PIreportburst.main(PIreportburst.java:51)
    -Below is the java code I'm using
    public void bEngine(String ctrlFile, String dataFile, String tmpDir) {
    try {
    DocumentProcessor dp = new DocumentProcessor(ctrlFile,dataFile,tmpDir);
    dp.process();
    catch (Exception e) {
    System.out.println(e);
    }

    Thanks Ike
    Where do you suggest setting the temp directory:
    DocumentProcessor("control.xml","data.xml","/u02/DIAS/bursting/BIPublisher/tmp/042308_104249338/xdo2.tmp")
    or in the xdo.cfg:
    <property name="system-temp-dir">/u02/DIAS/bursting/BIPublisher/tmp/042308_104249338/xdo2.tmp</property>
    ..and thanks for the link to the BIPublisherIDE
    Cheers, Mike

  • Packager fails with "Maximum file path name exceeded" on InCopy

    Attempting to build the full suite with CCP 1.5.0 Build 83, running on Window 8.1 update 64-bit.
    When building a 32-bit package it reaches InCopy it always stops and provides the so helpful "Maximum file path name exceeded error".  This appears to only happen when building the 32-bit package, building the 64-bit package caused no issues, and even in building the 32-bit package after the 64-bit package when everything is already downloaded the same error occurs.
    Tried it with:
    Cache path: C:\Users\iholmes\AppData\Local\Adobe\CCP\
    Destination path: F:\ISO\Adobe\Cloud\Working\CreativeCloud-06192014x86
    Also tried:
    Cache path: g:\Adobe\CCP
    Destination path: f:\cc\x86
    These are all local paths, not mapped network drives.

    Same here. From: C:\Users\<user>\AppData\Local\Temp\PDApp.log:
      <errorType>LongPathError</errorType>
      <filePath>C:\Users\<user>\AppData\Local\Temp\{839FDA1E-684B-4164-A8A0-AC83A4D37D3F}\AICY\ LS20\10.0\InCopy_10_LS20_Win32
    I can manually extract the zip file from:  C:\Users\<user>\AppData\Local\Adobe\CCP\AdobeCCPCache\AICY\LS20\InCopy_10_LS20_Win32.7z to the above path (which I think is what it's trying to do) with no error, so it seems to be something Adobe is going to have to fix.
    Someone else worked around it by creating a local user with a single character as the user name: Creative Cloud Packager Keeps Failing on InDesign: "Maximum File Path Name Exceeded"

  • Getting the local full path name of a file from an item File Browser

    Hi all,
    I would like to get the local full path name, of a file selected from an item 'File browser'.
    I see in wwv_flow_files the column 'name', but actually it's a kind of id like 'F1542335/myFile.gif' for example.
    What i want is the local path of this file ("C:\Documents and Settings\All Users\....\myFile.gif").
    I hope this is possible??
    Anyway, thanks all for reading.
    Ludo

    Hello, thank you for the answer.
    Please understand that I searched before posting, and not ony 15 min.
    What i mean is that the value of a File Browser in an Apex applocation is something like 'F1542335/myFile.gif', but what I need is the local path location.
    And 'F1542335/' is not the local path location, i can't use it. Or maybe there is a way to convert it in a proper path name, such as "C:\Documents and Settings\....", but I don't think so.
    So my question is : how to get the local path name of a file in Apex?
    I'll answer if I find some good things.
    Thanks
    Ludo
    Edited by: user12945874 on 06-avr.-2010 3:59

Maybe you are looking for

  • How do I add a Flash.swf file to an iWeb page?

    I have tried to use the HTML Snippet widget, but I must be doing something wrong. I can drag the .swf file into Safari and it plays. I am sure it is the order that I am trying to do this. Thanks for any help.

  • Problem with displaying images belonging to one keyword

    Hi, There seems to be a minor bug in Lightroom (since version 3): If I have no filter enabled and click on the little arrow next to a keyword, I get a result that is unrelated to the keyword. If I click it again, it works. So it seems that the featur

  • What settings to export IMovie to PS3

    Hi, I have been trying to export my videos as MP4 for playback on my PS3, and I have had no success. Does anyone here know what settings in IMovie will allow playback of videos on the PS3? Thanks

  • Cannot connect to internet with iMac connected to airport via Ethernet

    Hi all, Firstly please forgive if this problem has been posted before but unfortunately i haven't yet been able to find a solution to my problem. I cannot seem to get my wireless network to work since updating my Airport to v5.7. I have reverted back

  • Conversion string from a system unit to another

    Hi all i've a problem i'm talking with an oscilloscope. when i ask it some information like X or Y scale, it answers me a string (like 0.0016 to indicate 1.6m or 0.0000005 to indicate 500n). I'm finding difficulties because the first string to number