Why doesnt this see the file

This is what I have
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.lang.StringBuffer;
public class Length {
public static void main(String[] args) throws IOException{
//Lookig at blah.txt
File myFile = new File("C:\\Documents and Settings\\adam\\blah.txt");
     if(!myFile.exists()){
System.out.println("File not found");     
//Printing out Length, lastModified, and returning path to the file
     System.out.println("File length - "+ myFile.length());
     System.out.println( "File last modified - "+ new Date(myFile.lastModified()).toLocaleString() );//prints last modified
System.out.println("Path to file - " + myFile.getAbsolutePath());//prints Path
StringBuffer buffer = new StringBuffer(myFile.getName().trim());//cuting out white space
if (buffer.length() > 3){
String FileE = buffer.substring(buffer.length()-4);
System.out.println (FileE);//prints file extension
here is the output
File not found
File length - 0
File last modified - Dec 31, 1969 7:00:00 PM
Path to file - C:\Documents and Settings\adam\blah.txt
.txt
why cant it find the file

This should work too if it makes thing simpler
File myFile = new File("\"C:\\Documents and Settings\\adam\\blah.txt\"");

Similar Messages

  • Why has this occurred The file "iTunes Library.itl" does not appear to be a valid iTunes library file. iTunes has created a new iTunes library and renamed this file to "iTunes Library (Damaged)".

    My itunes library suddenly that the file “iTunes Library.itl” does not appear to be a valid iTunes library file. iTunes has created a new iTunes library and renamed this file to “iTunes Library (Damaged)”. I use an external hard drive for my Itunes.

    The library file appears to have been corrupted.  You say you use your external drive but is the whole library on it or only your media?  No matter, you will have to rebuild the library file:
    iTunes: How to re-create your iTunes library and playlists - http://support.apple.com/kb/ht1451

  • HT5622 why do I see the message "This apple ID has not yet been used in the itunes store"when I enter my password in app store or itunes??

    why do I see the message "This apple ID has not yet been used in the itunes store"when I enter my password in app store or itunes?

    Look at the options for payment methods.  Is there an option that says "None?"
    The short answer for this and for your next question is, "Read what the iPhone is telling you."

  • HT204053 Why do I see the message "the maximum number of free accounts have been activated on this iphone" when I enter password?

    Why do I see the message "the maximum number of free accounts have been activated on this iphone" when I entered password?

    Welcome to the Apple Community.
    Unfortunately once all the 3 iCloud accounts have been created on your mobile device, you cannot create any more regardless of what you do. You will need to re-use one of the accounts that you have already created or create your new account on another device or computer.

  • In Spotlight, Why can't I see the file location?

    There has been a loss of a feature from 10.6 SL or 10.7 Lion....
    When I search for a file in Spotlight, I want to see the file location. Instead, I get the file preview. Is there a way to set a perference so I can actually "find" my file in the folder instead of just viewing it.

    You're welcome!

  • Why I cant see PDF files in skydrive on my Mac air?

    why cant I see pdf files in skydrive ?

    Found the solution online!
    An easy way to locate a file is to open the Finder. From the menu bar click Go > Go to Folder
    Type this in exactly as you see it here >     /Library/Internet Plug-ins
    If you see the PDF Browser plugin, move it to the Trash.
    Relaunch Safari to test.

  • External table, can't see the file

    Hi
    --This is what I do
    CREATE OR REPLACE DIRECTORY data_dir AS 'C:\TEMP\'
    GRANT READ, WRITE ON DIRECTORY data_dir TO my_user;
    --I have my actual GAS.TXT file in the folder, the file looks like this
    0003450305NG-5E6, TUSCANY VILLAS,26 FENTON STREET ROTORUA 3201, ROTORUA
    002343043NG-9DE, LORALIS LIMITED,18 HARINGTON STREET TAURANGA 3001, TAURANGA
    ...etc...
    --I do a select
    SELECT * FROM all_directories
    --and it shows
    SYS DATA_DIR C:\TEMP\
    --Then I create my ext table like this
    CREATE TABLE external_table(
    ICP CHAR(10) ,
    NAME CHAR(20),
    ADDRESS CHAR(30),
    CITY CHAR(20)
    ORGANIZATION EXTERNAL
    ( TYPE oracle_loader
    DEFAULT DIRECTORY DATA_DIR
    ACCESS parameters
    (RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"' AND '"'
    (ICP CHAR(40),
    NAME CHAR(100),
    ADDRESS CHAR(100),
    CITY CHAR(100)
    location (DATA_DIR:'GAS.TXT')
    --The table is created
    --then when I try and do a select I end up with an error message
    SELECT * FROM EXTERNAL_TABLE
    ORA-29913 blah, blah
    ORA-29400 blah blah
    KUP-04040 file can't be found
    ORA-06512 SYS.ORACL_LOADER
    ORA-06512 blah blah
    So, I reckon of some reason it can't see the file, but I do not know why?
    The file sits on the Server in the C:\TEMP folder and the error log ends up in the C:\TEMP folder
    I have tried several variations on this, but still same error. However, then I also tried these exact same scripts on another Oracle box, and it worked fine. So something with the machine/box I am using is not alright.
    Would appreciate your thoguhts.
    Thanks
    Kari

    As suggested, change your table definition to match the available data, and post an example like below with complete error message (not the edited version that is hard to understand).
    SQL> $ type c:\temp\gas.txt
    0003450305NG-5E6, TUSCANY VILLAS,26 FENTON STREET ROTORUA 3201, ROTORUA
    002343043NG-9DE, LORALIS LIMITED,18 HARINGTON STREET TAURANGA 3001, TAURANGA
    SQL> CREATE OR REPLACE DIRECTORY data_dir AS 'C:\TEMP\'
      2  /
    Directory created.
    SQL> CREATE TABLE external_table(
      2  ICP CHAR(16) ,
      3  NAME CHAR(20),
      4  ADDRESS CHAR(35),
      5  CITY CHAR(20)
      6  )
      7  ORGANIZATION EXTERNAL
      8  ( TYPE oracle_loader
      9  DEFAULT DIRECTORY DATA_DIR
    10  ACCESS parameters
    11  (RECORDS DELIMITED BY NEWLINE
    12  FIELDS TERMINATED BY ','
    13  OPTIONALLY ENCLOSED BY '"' AND '"'
    14  (ICP CHAR(40),
    15  NAME CHAR(100),
    16  ADDRESS CHAR(100),
    17  CITY CHAR(100)
    18  )
    19  )
    20  location (DATA_DIR:'GAS.TXT')
    21  )
    22  reject limit unlimited
    23  /
    Table created.
    SQL> select * from external_table ;
    ICP              NAME                 ADDRESS
    CITY
    0003450305NG-5E6 TUSCANY VILLAS       26 FENTON STREET ROTORUA 3201
    ROTORUA
    002343043NG-9DE  LORALIS LIMITED      18 HARINGTON STREET TAURANGA 3001
    TAURANGA
    2 rows selected.
    SQL>Message was edited by:
    Kamal Kishore

  • How can I display the front panel of the dinamically loaded VI on the cliente computer, the VI dinamically loaded contains files, I want to see the files that the server machine has, in the client machine

    I can successfully view and control a VI remotly. However, the remote VI dinamically loads another VI, this VI loaded dinamically is a VI that allows open others VIs, I want to see the files that contains the server machine, in the client machine, but the front panel of the dinamic VI appears only on the server and not on the client, How can I display the fron panel with the files of the server machine of the dinamically loaded VI on the client computer?
    Attachments:
    micliente.llb ‏183 KB
    miservidor.llb ‏186 KB
    rdsubvis.llb ‏214 KB

    I down loaded your files but could use some instructions on what needs run.
    It seems that you are so close yet so far. You need to get the data on the server machine over to the client. I generally do this by doing a call by reference (on the client machine) of a VI that is served by the server. THe VI that executes on the server should pass the data you want to diplay via one of its output terminals. You can simply wire from this terminal (back on the client again) to an indicator of your choosing.
    Now theorectically, I do not think that there is anything that prevents use from getting the control refnum of the actual indicator (on the server) of the indicator that has the data, and read its "Value" using a property node. I have never tried this idea but it seems t
    hat all of the parts are there. You will need to know the name of the VI that holds the data as well as the indicator's name. You will also have to serve all VI's. This is not a good idea.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Which version doesn't produce this error: "there was an error opening this document. the file is damanged and could not be repaired"?

    This error message occasionally occurs with Acrobat 5 on XP 2.  However the same files can be opened with Acrobat 6.0.4 on Win98(se2).
         "There was an error opening this document. the file is damanged and could not be repaired."
    I'd like ot upgrade 5 on my XP system, but have read many posts complaining about the same error with newer versions.
    Is there a version that never produces this error on files that aren't actually damaged? And has anyone figured out what produces this error? (The posts I've seen suggest solutions that don't seem to work.)
    Thanks.
    Ellen

    Thanks, Prasanth.
    I've read posts about this problem happening on all versions, and wanted to see if it was least likely to happen in one version.
    I just need the basic function - the ability to read a pdf file.
    Of course, it seems to be a problem only for some, and there's no way of knowing the extent, so I will try an upgrade or two.
    Ellen

  • Acrobat 11 there was an error opening this document. the file is damaged and could not be repaired

    we are receiving an error when opening certain pdfs saying "there was an error opening this document. the file is damaged and could not be repaired"
    i've tried a few things to fix this issue with no luck
    tried on a brand new windows 7 install without any added software like anti-virus software, etc
    tried on my home pc (I forwarded the document from my work pc to my home pc and still receiving the same error)
    don't think it's anything related to the computers, thinking it's more an issue with the pdf. i've tried the basics like deleting temp files from IE, going to %temp% and deleting that out, doing an acrobat repair, trying in reader instead of acrobat, updating users from acrobat 10 to 11, and still receiving the same issue. the odd thing is, some people can open this document and some receive the error. the other thing is i've tried alternative pdf programs with no avail, same errors from those as well
    i work on the helpdesk with one other person  for the company and not sure what else we can try
    don't think this is a pc issue - tried on pcs in the company, home pcs, personal pcs and all get this error
    got to be an issue with either the pdf, or the way its being sent
    i did reach out to OUR e-mail team here (lotus notes admin) and they've ruled out anything as far as an encryption causing the conflict may go, so notes isn't the issue either
    would it be possible it's on the persons end that's sending the file?

    Unfortunately, CR 10.5 is not supported on WIN 2012 Server. See this wiki for more details. In order to work in a supported environment you will have to upgrade to CR 2008 Service pack 7, or SAP Crystal Reports, developer version for Microsoft Visual Studio (2010 / 2012 / 2013).
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • HT1926 just installed latest itunes to my pc, but now getting this message' the file itunes Library.itl cannot be read because it was created by a newer version of itunes. and now i cannot open itunes?

    just installed latest itunes to my laptop, and icon is on my homepage, but when i try to load it up, i get this message ,The File "itunes Library.itl" cannot be read because it was created by a newer version of itunes! Ive tried uninstalling it then installing again but nothing, ive ran scans on both itunes and quicktime to see what the problem is, and i just keep gettin this message! how do i fix this ANYONE please!

    The file "iTunes Library.itl" cannot be read because it was created by a newer version of iTunes".
    Try the following user tip:
    Empty/corrupt iTunes library after upgrade/crash

  • Time Machine will not let me restore from backups after June, 2013.  I can see the files on the external hard drive but Time Machine skips all of them and goes back to June, 2013. Does anyone have any idea what the problem is?

    Time Machine will not let me restore from backups after June, 2013.  I can see the files on the external hard drive but Time Machine skips all of them and goes back to June, 2013. Does anyone have any idea what the problem is?

    rtilghman wrote:
    telling me to buy a new router is NOT a solution.
    And why not? Apple is selling these things like BigMacs. They can't make enough of them. You've been suffering since May because you refuse to get a decent router.
    Can you imagine if a company that makes a refrigerator told me that I needed to upgrade my electrical system to rectify a problem with their device? What kind of response IS that?!?!
    What if the problem with their device is that it requires a new-fangled "grounded" outlet and your circa 1890 house doesn't have grounded outlets. Would you refuse to purchase a $ 25 adapter on principle?

  • Unable to see the file share content via UNC path

    I have run a cmd command to modify the NTFS permissions on a few home directories.
    That command has helped me to remove all from the ACL of shared folders; and add domain admins into it.
    I am an admin on that Windows server. Now, whenever I try to access any home directory via UNC path; it doesn't displays the files and folders in it. But, if I go to the server and try to open the particular home directory from there...first it gives me
    a prompt that I currently do not have access on folder and then gives me an option to click on continue and then I can access the files and folders within the directory.
    I am also able to see the files and folders in the directory via UNC path after doing the above steps.
    Can somebody help me understand what I did wrong here and how can this be resolved now?

    Sorry, am added into local administratir group. But, NTFS permissions shows that I have only "read" and "change" permissions (I have checked this from effective permissions).
    The ACL of folder shows only "Domain Admins" have full access and I am not a part of AD group "Domain Admins". I think this is the root cause of the issue.
    I am running below mentioned command to give myself full access on the file shares without making any changes to the current ACL of all shared folders. However, it is not working and not even throwing any error message.
    for /f %i in (u:\users.txt) do cacls \\hdfile01\users$\%i /C /G "AMadm":F
    users.txt contains 'cn'. Another thing to notice here is that if I just keep one ID in .txt file and then run my command; it is working. But its not running for all users in loop.
    Can somebody please help.

  • I don't have a customize shape option in my photoshop CC.  Why is this?  The only shape I can do is rectangle.

    I don't have a customize shape option in my photoshop CC.  Why is this?  The only shape I can do is rectangle.

    You do have to press and hold down the mouse more than a few seconds to see the fly-out menu of other shapes, or use the shortcut shift-u.
    If you have already done that. Try resetting the Shape tool. Select it, and in the option bar, right or ctrl-click (Mac) on the icon, choose Reset Tool.
    Gene

  • I can't see the files on my USB disk

    I know there are about 250 million threads about airport USB disk problems, but I can't see one with my specific drama.
    I can connect, see the drive (its a LaCie 250GB) and move stuff to it via the airport. The problem is that I cant see the files once they are on the LaCie. The finder window will start to show each folder but after about 1 second all the folders dissapear and the finder says "0 items, 91.38 GB available".
    Obviously the computer is reading the drive as it knows how much space is on there, and it can write to the drive - it just wont display the folders. If I connect using a USB cable then all is well, so its just the ***** airport!
    Someone please help, I'm going mad!

    The disk sharing utility creates separate folders which are not visible when connected to the AEBS, but are when directly connected via USB to your computer:
    "Shared" > for all mainly shared files and folders
    "[Username]" > for all user related files and folders when you use account to access your disks through the AEBS via Airport.
    So if you first connect your disk directly to your PC, make sure you copy your files to the "Shared" directory (and not directly in the root), and if you did not connect the disk to the AEBS before, or the "Shared" directory does not exist, make this folder yourself.
    Goodluck!

Maybe you are looking for

  • Services in empty input fields

    I am creating a very simple Service which will just paste some frequently used text. My problem is that if there is no text in an input field (in Safari but also elsewhere) the Text services don't appear when I right-click. Is there any way to create

  • 'T' in Date datatype

    Hi, I have a date in "2008-06-16T15:20:20.360" format. It has a separator "T" to indicate time. I want to store this in a Date data type field in my table. Is this possible in Oracle? Can I do this without changing my data type to Varchar2? Thanks, D

  • External Drive Does not show any file in finder

    I do not see any file in my external hard drive. It a 2TB hard drive and in info it shows 727 GB remaining. I am sure files are there but for some reason they are not showing in finder. I am using iMac 10.6.8

  • How to make Safari stop asking whether to trust app Signature

    I'm running Safari 4.0.5 on a Tiger system. When I sign on to my work VPN (I go to a website, enter credentials, and it starts up Network Connect), it always says "this applet was signed by ... and then I have to hit "Trust" or "Don't trust" or "Exam

  • Bonjour, comment je peut copier des photos non prise avec l'iphone mais synchronisé vers un ordinateur ?

    bonjour, j'ai un iphone 3g avec des photos que je ne veut pas perdre, cependant je n'est plus l'ordinateur avec le quel j'ai synchronisé les photos, il me reste donc une seul copie des photos qui sont sur l'iphone mais se ne sont pas des photos prise