File reader question

I am getting the folling error on many lines of code: "class, interface, or enum expected".
Here is my code.
import java.io.FileReader;
import java.io.File;
import java.util.*;
import java.io.*;
Class FileReadingTester
     public static void main(String[] args)
          File WebExportFile =
          new File("C:\\Temp\\TextFileTest\\WebExport1.txt");
          FileReader WebExportTestReader = new FileReader(WebExportFile);
          char [] CharBuffer;          
          CharBuffer = read(CharBuffer, 0,5);
          System.out.println(CharBuffer);
}

flounder wrote:
Java is case sensitive. It is class not Class.
>Java is case sensitive. It is class not Class.
Having trouble with the read call from the FileReader class.
Here is the complete code. Error is in comments.
Here is the documentation for the read method (between curly braces):
read
public abstract int read(char[] cbuf,
int off,
int len)
throws IOExceptionRead characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.
Parameters:
cbuf - Destination buffer
off - Offset at which to start storing characters
len - Maximum number of characters to read
Returns:
The number of characters read, or -1 if the end of the stream has been reached
Throws:
IOException - If an I/O error occurs
What is wrong with this?
import java.io.FileReader;
import java.io.File;
import java.util.*;
import java.io.*;
class FileReadingTester
     public static void main(String[] args)
          File WebExportFile =
          new File("C:\\Temp\\TextFileTest\\WebExport1.txt");
          FileReader WebExportTestReader = new FileReader(WebExportFile);
          char [] CharBuffer = new char[6];
          char [] CharResult = new char[6];          
                                // below line gets this error: .class expected.
                                // The arrow points to the comma immediately after CharBuffer[].
          CharResult[0] = FileReader.read(CharBuffer[], 0,5);
          System.out.println(CharBuffer);
}

Similar Messages

  • File Reading Question

    I am able to read a single line of a file and count the tokens, but I want to be able to read every line in the file and count all the tokens, any suggestions.
    Thanks....
    import java.io.*;
    import java.util.Scanner;
    public class Assignment1
         private static BufferedReader fileName = new BufferedReader (new InputStreamReader (System.in));
         public static void main(String[] args) throws IOException
              System.out.print("Enter the file name: ");
              String input = fileName.readLine();
              File selectedFile = new File( "assignment1Test1.txt" );
              File selectedFile2 = new File( "assignment1Test2.txt" );
              File selectedFile3 = new File( "assignment1Test3.txt" );
              if (input.equals("assignment1Test1") && selectedFile.exists())
                   BufferedReader FileIn = new BufferedReader( new FileReader( selectedFile ) );
                   String line = FileIn.readLine();
                   while ( line != null )
                             java.util.StringTokenizer st = new java.util.StringTokenizer( line, " " );
                             int numWords = st.countTokens();
                             System.out.println(numWords);
                   FileIn.close();
              else if (input.equals("assignment1Test2"))
                   System.out.println("#2 works");
              else if (input.equals("assignment1Test3"))
                   System.out.println("#3 works");
              else
                   System.out.println("File Not Found");
    }

    String line = FileIn.readLine();
    while ( line != null )
        java.util.StringTokenizer st = new java.util.StringTokenizer( line, " " );
        int numWords = st.countTokens();
        System.out.println(numWords);
    }How does it work? You read something into the line variable and then it never changes. You should be stuck in an infinite loop.
    String line = null;
    while ((line = FileIn.readLine()) != null )Try that instead. Everytime you go around the loop you will read another line and store it in your variable.
    Edited by: Quacked on Jan 18, 2008 4:33 PM

  • Concurrent File Read Question

    Hi:
    I am writing a multi-thread program to read from one large file. Different thread will read different part of the file so they do not interfere.
    I am considering using the java.nio's memory-mapped I/O since the file is pretty large. But I cannot find any document regarding
    the thread-safeness of the API.
    Suppose the file is mapped to a MappedByteBuffer, and two threads issue two gets() operations concurrently, can the two gets() run concurrently or the second one has to be blocked until the first one returns, or even worse, incorrect result may be returned?
    Thanks,
    -Yi
    Edited by: grantguo on Oct 22, 2008 11:52 PM

    You don't know what flock() and flock16() function are in Platform OS's.Your guesswork about the extent of my knowledge is just as uninformed and irrelevant as everything else you've posted here. You're certainly in no position to lecture me about flock() when you don't know what it does yourself.
    So a very good clue about java thread-safeness implicitly is java.nio.channels.FileChannel methods for locking and locking zones of a file.In other words you haven't even read the Javadoc for the solution you're recommending. The quotation in Roy's post above shows that FileLock cannot possibly be the solution to any threading problem.
    The rest of your posting is equally irrelevant and erroneous. I wrote a paper criticising the semantics of lockf(), now flock(), in 1984. Whatever flock16() may be, Google doesn't know what it is either. Both are irrelevant. Every OS I have ever used allows concurrent reads to a file, unless you lock it. Neither Unix nor Windows has a 'VM level'. The 'JVM base drivers' are a figment of your imagination. There are no drivers in the JVM. What you're talking about is just the JVM.
    The OP's 'main worries' are precisely this: whether it is thread-safe to read a file via multiple threads via a MappedByteBuffer. He has no need to lock the file and it wouldn't solve this problem even if he did. It wouldn't solve any problem unless there were simultaneous writers to the file, which he hasn't mentioned.
    He may need to synchronize the threads against each other because MappedByteBuffer isn't documented to be thread-safe (although I suspect that the methods that take an offset argument actually are).
    Most of this has already been stated above, before you appeared in the discussion. You're just wasting time and space with your erroneous and irrelevant contributions. You've been warned about this before and you've been blocked before on account of it. Moderators are watching this thread and your other postings.

  • I got new hard driver for my MacBook I don't have the cd but I do have flash drive that has the software I need help because when I turn on my laptop it shows me a file with question mark how can I install the software from the flash driver?

    I got new hard driver for my MacBook I don't have the cd but I do have flash drive that has the software I need help because when I turn on my laptop it shows me a file with question mark how can I install the software from the flash driver?

    Hold down the Option key while you boot your Mac. Then, it should show you a selection of devices. Click your flash drive and it will boot from that.

  • How can I make Keynote files read-only (eg: to share with students)?

    I would like to share some keynote files with students, and I would like to set them up as read-only, so that the students can tap the screen, read my presentation, but not alter it.  I've tried to set the files up as read-only on my iMac desktop, but when I load the file onto my iPad, it's still editable.
    Any ideas re: how to make Keynote files read-only?
    I've tried to export the files as PDF and load them into iBook, but some of Keynote's basic "build" functions won't work this way.  Specifically, I have files set up with questions and answers (ie - a question appears, and you have to tap the screen to see the answer, but this "build" function seems to disappear when I get it to show up in iBook).
    Any ideas how to make Keynote files read-only?  I am happy to use another program, but I want the students to tap the screen in order to see the answer to a question.
    Thanks!

    as long as $PATH is set, you shouldn't need to reconnect them (i think).  if you send the list of apps through | awk -F '/' '{print $NF}' | that'll strip the path
    /edit: added the "(i think)" part
    Last edited by brisbin33 (2009-06-02 21:33:06)

  • A serious issue with excel file read in ODI

    hi gurus,
    Issue with excel file read is that we can read only one file by setting the path from ODBC Data Source Administrator-->System DNS -->Select Work book
    what i want to read the dynamic path(Every time I cant go back and set the Work book to select the excel file..
    So i came up with a solution to write a Vbscript that convert the excel to csv my problem got solved for dynamic paths the script is as follow:
    Set objArgs = WScript.Arguments
    For I = 0 to objArgs.Count - 1
    FullName = objArgs(I)
    FileName = Left(objArgs(I), InstrRev(objArgs(I), ".") )
    Set objExcel = CreateObject("Excel.application")
    set objExcelBook = objExcel.Workbooks.Open(FullName)
    objExcel.application.visible=false
    objExcel.application.displayalerts=false
    objExcelBook.SaveAs FileName & "csv",23
    objExcel.Application.Quit
    objExcel.Quit
    Set objExcel = Nothing
    set objExcelBook = Nothing
    Next
    Now this script convert the xls file to csv with comma seprated values
    e.g in excel sheet if data is ABC XYZ PQR
    csv will come with ABC,XYZ,PQR
    here the delimiter is , i want the delimiter as pipe | who's ascii code is 124
    but if i change 23 with 124 its not working i getting the error cannot save as...
    can anyone tell me that what should be the correct code for pipe
    so that the output is ABC|XYZ|PQR
    AS WE CAN USE THE SCRIPTS IN TOOLS
    Edited by: 789141 on Sep 14, 2010 11:33 PM

    I dont have the answer for your question but i have different approach in handling multiple Excel File.
    Step 1. Copy a sample source Excel File and Call it Final.xls .
    Step 2. Map this Final.xls to DSN and in Topology call this Final.xls
    Step 3. Do the Reversing and Map and test the Interface . Once its done.
    Step 4. Create a Package and using a http://odiexperts.com/?p=1426 get the list of all the Excel File
    Step 5 . Using this http://odiexperts.com/?p=273 create a Loop to Read the Excel File name
    Step 6 . Copy using OdiFileCopy to Final.xls and run your interface .
    Step 7. Increment the Loop and copy your next File for Final and run the interface
    Step 8 . Finally you will be able to read all the Excel File .
    Step 9 . Delete the source file [ Optional ]
    Hope this helps.

  • Synchronous File Read on Invoke Problem

    I am trying to invoke file adapter to read the file once(Synchronous File Read) as described in Bpeltechadapter guide.
    Read about Synchronous File Reading Capability here download.oracle.com/otndocs/products/bpel/bpeltechadp.pdf
    Also read this: Re: Help! Three questions about FileAdapater. .
    I get this process generation failed when i try to build it. The Empty_msg in inputvariable of invoke works but problem is with Charges_msg in output variable.
    I am sure its something to do with ns but not getting it to work.
    PL_FileInbound.WSDL code*********************
    <definitions
    name="PL_FileInbound"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/PL_FileInbound/"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/file/PL_FileInbound/"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
    xmlns:imp1="http://TargetNamespace.com/FA_ReadFile"
    xmlns:hdr="http://xmlns.oracle.com/pcbpel/adapter/file/"
    >
    <import namespace="http://xmlns.oracle.com/pcbpel/adapter/file/" location="fileAdapterOutboundHeader.wsdl"/>
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/PL_FileInbound/">
    <import namespace="http://TargetNamespace.com/FA_ReadFile" schemaLocation="PipeDelimitedNIX_Charges.xsd" />
    <element name="empty"><complexType/></element>
    </schema>
    </types>
    <message name="Chargesheet_msg">
    <part name="Chargesheet" element="impl:Chargesheet"/>
    </message>
    <message name="Empty_msg">
    <part name="Empty" element="tns:empty"/>
    </message>
    <portType name="SynchronousRead_ptt">
    <operation name="SynchronousRead">
    <input message="tns:Empty_msg"/>
    <output message="tns:Chargesheet_msg"/>
    </operation>
    </portType>
    <binding name="SynchronousRead_binding" type="tns:SynchronousRead_ptt">
    <jca:binding />
    <operation name="SynchronousRead">
    <jca:operation
    PhysicalDirectory="C:\Incoming"
    InteractionSpec="oracle.tip.adapter.file.outbound.FileReadInteractionSpec"
    FileName="abcl.txt"
    DeleteFile="false"
    OpaqueSchema="false">
    </jca:operation>
    <input>
    <jca:header message="hdr:OutboundHeader_msg" part="outboundHeader"/>
    </input>
    </operation>
    </binding>
    <service name="PL_FileInbound">
    <port name="SynchronousRead_pt" binding="tns:SynchronousRead_binding">
    <jca:address location="eis/FileAdapter" />
    </port>
    </service>
    <plt:partnerLinkType name="Read_plt" >
    <plt:role name="Read_role" >
    <plt:portType name="tns:SynchronousRead_ptt" />
    </plt:role>
    </plt:partnerLinkType>
    </definitions>
    BPEL Source ******************************************
    <!--
    // Oracle JDeveloper BPEL Designer
    // Created: Sat Apr 29 16:52:43 CDT 2006
    // Author: dpatel
    // Purpose: Synchronous BPEL Process
    -->
    <process name="SynchronousFileRead"
    targetNamespace="http://xmlns.oracle.com/SynchronousFileRead"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/PL_FileInbound/"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:client="http://xmlns.oracle.com/SynchronousFileRead"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <!-- ================================================================= -->
    <!-- PARTNERLINKS -->
    <!-- List of services participating in this BPEL process -->
    <!-- ================================================================= -->
    <partnerLinks>
    <!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="client:SynchronousFileRead"
    myRole="SynchronousFileReadProvider"/>
    <partnerLink myRole="Read_role" name="PL_FileInbound"
    partnerRole="Read_role" partnerLinkType="ns1:Read_plt"/>
    </partnerLinks>
    <!-- ================================================================= -->
    <!-- VARIABLES -->
    <!-- List of messages and XML documents used within this BPEL process -->
    <!-- ================================================================= -->
    <variables>
    <!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable"
    messageType="client:SynchronousFileReadRequestMessage"/>
    <!--
    Reference to the message that will be returned to the requester
    -->
    <variable name="outputVariable"
    messageType="client:SynchronousFileReadResponseMessage"/>
    <variable name="Invoke_1_SynchronousRead_InputVariable"
    messageType="ns1:Empty_msg"/>
    <variable name="Invoke_1_SynchronousRead_OutputVariable"
    messageType="ns1:Chargesheet_msg"/>
    </variables>
    <!-- ================================================================= -->
    <!-- ORCHESTRATION LOGIC -->
    <!-- Set of activities coordinating the flow of messages across the -->
    <!-- services integrated within this business process -->
    <!-- ================================================================= -->
    <sequence name="main">
    <!-- Receive input from requestor.
    Note: This maps to operation defined in SynchronousFileRead.wsdl
    -->
    <receive name="receiveInput" partnerLink="client"
    portType="client:SynchronousFileRead" operation="process"
    variable="inputVariable" createInstance="yes"/>
    <!-- Generate reply to synchronous request -->
    <invoke name="Invoke_1" partnerLink="PL_FileInbound"
    portType="ns1:SynchronousRead_ptt" operation="SynchronousRead"
    inputVariable="Invoke_1_SynchronousRead_InputVariable"
    outputVariable="Invoke_1_SynchronousRead_OutputVariable"/>
    <!--outputVariable="Invoke_1_SynchronousRead_OutputVariable"-->
    <reply name="replyOutput" partnerLink="client"
    portType="client:SynchronousFileRead" operation="process"
    variable="outputVariable"/>
    </sequence>
    </process>
    I would really appreciate your help here.

    I face the same issue and I have given all permissions to the folder for OS user.
    Because of this error my server is not starting up . Is there any way I can undeploy this composite to get my server running.
    I cant do this from EM because SOA server is failing to start up.
    I have tried removing it from $DOMAIN_HOME/deployed-composites but still when i try restarting the soa server the composite comes up there. Do we need to delete the entry some where else too. Kindly help.
    Thanks,
    Sri.

  • Having alot of trouble in file reading in java

    i dont know. but i feel really bad that Java is a very good OOP language and i suck big time (not very bad but got frustrated) in reading and writing files. some of the time i have accomplish my task with the help of forums. anyways first i would like to ask 2 questions and then i will state my problem. say for instance if i have a file with name amount and dollars. how can i read it?
    i know i can use string regex split method in order to split the line but how can i create a method to do some changes in the text file like i have a name, bank account # and amount to deposit in the text file. my question is how can i declare my method to read (Name) first column and price second column and amount to deposit the third colum?
    Secondly if i have a text file and i would like to replace all <<A>> with the name and <<G>> with the age. if i wanted to do without reading a file no problem create a string and then use the replaceAll method ("<<A>>", "Jaan") but for some reason i can't do it when i read a file. yes i am searching on google to get more understanding in reading file. but anyone care to explain wil be great. God bless you my Son.
    import java.io.*;
    import java.util.*;
    class ReadData {
         private Scanner s;
         private static final String EMPTY_STRING = "";
         private String line1;
         private static String lineTerminator = System.getProperty("line.separator");
         public static void main(String[] args) throws IOException {
              ReadData read = new ReadData();
              read.start();
         public ReadData() {
              s = new Scanner(System.in);
         public void start() throws FileNotFoundException, IOException {
              System.out.println("Enter the file name");
              try {
              String name = s.next();
              openFile(name);
              catch (FileNotFoundException e) {
                   e.printStackTrace();
              catch (IOException e) {
                   e.printStackTrace();
         public String openFile(String filename) throws FileNotFoundException, IOException {
              String line;
              String line2;
              StringBuffer document = new StringBuffer(EMPTY_STRING);
              File inFile = new File(filename);
              FileReader fileReader = new FileReader(inFile);
              BufferedReader bufReader = new BufferedReader(fileReader);
              while(true) {
                   line = bufReader.readLine();
                   if(line==null) break;
                   document.append(line + lineTerminator);
                  System.out.print(document.toString());
              return document.toString();
    }

    i dont know. but i feel really bad that Java is a
    very good OOP language and i suck big time (not very
    bad but got frustrated) in reading and writing files.
    some of the time i have accomplish my task with the
    help of forums. anyways first i would like to ask 2
    questions and then i will state my problem. say for
    instance if i have a file with name amount and
    dollars. how can i read it?Just like you'd read any other file. How you interpret what you've read depends on the specific format of the file, which you've provided no information about.
    i know i can use string regex split method in order
    to split the line but how can i create a method to do
    some changes in the text file like i have a name,
    bank account # and amount to deposit in the text
    file. my question is how can i declare my method to
    read (Name) first column and price second column and
    amount to deposit the third colum? What do you mean? You want to read the entire first column, from all lines, then the entire second column, etc.? Unless you know the length of each line ahead of time so you can use RandomAccesFile, you can't do that. If that's not what you mean, then please clarify.
    Secondly if i have a text file and i would like to
    replace all <<A>> with the name and <<G>> with the
    age. if i wanted to do without reading a file no
    problem create a string and then use the replaceAll
    method ("<<A>>", "Jaan") but for some reason i can't
    do it when i read a file.
    Create a tmp file.
    For each line {
      Read a line.
      Do the replacement on the string you read.
      Write the new line out to the temp file
    rename the temp file to the original
    anyone care to explain wil be great. God bless you my
    Son.I'm not your son. Keep your god away from me.

  • File management questions with iPhoto 8

    I am new to iPhoto, not just version 8. I need to understand a few basics about the Apple way of handling photos. First off let me say that I have a MacBook Pro and a Windows XP desktop pc. I just set up an external harddrive as my storage space for my photos. They were on my pc, but I want to take advantage of iPhoto and manage them via my mac laptop. So I formatted the external drive as a mac drive, purchased a copy of MacDrive so that my pc can read/write to this drive as well and transferred all of my photos to the external harddrive. 14 gigs. I suppose I should now delete them off my pc...
    Before I moved my photos, I organized them all into appropriate folders, consolidating them and removing any duplicates that occured sometimes when I accidentally re-imported the same photos from my camera.
    I imported the photos on my external harddrive into iPhoto's photo library, using the alias approach instead of having iPhoto make copies of the photos. (I don't need to waste yet another 14 gigs!) So now I have numerous Events, most of which relate directly to the folders I created for my photos. I noticed however that in some instances, iPhoto created multiple events for photos within the same folder.
    Here are my questions...
    If I merge events in iPhoto, I noticed my folders do not change. Am I just messing around with the aliases, sorta like creating playlists in iTunes? Is there any way to keep things in sync between my folders and my events, so that the contents of my folders match the contents of my events, or is this unwise or unnecessary?
    If after I have imported my photos into iPhoto, what happens when I merge my folders of photos on my harddrive, outside of iPhoto? Does iPhoto keep up or do I have to somehow update my iPhoto library? Refresh it? What happens when I add more photos, say with my pc? Do I have to import the new folders of photos into iPhoto each time?
    I also have a question about keywords. From the demo movie I watched on apple.com, I saw that one can search for photos using keywords. In the demo, the presenter typed the name of a person and all the pictures of that person appeared. If I want to do this, does this mean I have to add for example the keyword "David" to every picture David is in? Can the name simply appear in the title for the photo and still get picked up within the search results? Is there an easy way to assign keywords to multiple photos at the same time?
    Thanks for helping me start out on the right foot!
    Paul

    Dani:
    You don't have to duplicate photos when using iPhoto in it normal, copy to library, mode. Once you import the files you can delete the ones used to import. However, if you're a professional then you've probably read the DAM book, Digital Asset Management, and it implies multiple backup copies.
    Files imported in the alias mode retain the color profile that was added by the camera. If you edit in iPhoto then the resulting modified will will have a default profile. In my case the profile went from sRGB IEC1966-2.1 to Camera RGB Profile. But if you use Photoshop as your editor of choice in iPhoto you can manage the profile with it.
    I like iPhoto 7 much more than 6. It's editing capabilities are much improved but still no match for PS. It also writes the metadata, comments, keywords and title to the file when exporting. It also allows you to modify the EXIF Capture Date and write it to the original file.
    As with any application you must have backups and backups. Also always keep a minimum of 10 GB free space, 15 or more if you'll be doing some heavy editing with PS or work with video. That's important. So that means an external FW hard drive or two for redundancy backups. That is if you're serious about it.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • HT1752 My MacBook on startup shows file with question mark ,, what now?

    My Mac shows file with question mark, what now.

    Press the power button down to force a emergency use only hardware shutdown.
    Press and hold the Option/alt key on the built in keyboard, boot the machine.
    If MacintoshHD appears, select it and click the arrow, then in System Preferences > Startup Disk reset that. Done.
    Sometimes a NVRAM reset is required then the above done again.
    Folder with question mark issue
    ..Step by Step to fix your Mac
    If MacintoshHD doesn't appear, or if it boots to gray screen or other issues, then it's more complicated of a fix, but once inside OS X then reset the Startup Disk.
    Gray, Blue or White screen at boot, w/spinner/progress bar
    ..Step by Step to fix your Mac
    You might need this if you don't have a recent backup and your problem is software related, Disk Utiltiy can't fix the drive and recommends you backup, erase and install.
    .Create a data recovery/undelete external boot drive
    If Disk Utility + Hardware Test shows no boot drive, then you have a dead drive or cable, or Mac issue.
    My computer is not working, is my personal data lost?

  • Mdworker deny file-read-data, what does it really mean?

    I get numerous log posts like this:
    3/17/14 7:22:57.561 AM sandboxd[5688]: ([4412]) mdworker(4412) deny file-read-data /Volumes/Time Machine Backups/Backups.backupdb/Jack Shelton’s iMac/2014-03-17-042247/JackHD/System/Library/Fonts/TimesLTMM (import fstype:hfs fsflag:4809018 flags:48200000056 diag:0 uti:com.apple.font-suitcase plugin:/Library/Spotlight/Font.mdimporter - find suspect file using: sudo mdutil -t 235288)
    My questiions are:
    What is being sandboxed, the mdworker or the file Times LTMM or the mdimporter?
    Which one has the sudo command in it?
    What does the -t flag/option mean?  Looking it up via man mdutil in the terminal, it does't exist.
    I saw this type of post quite frequently in Mavericks so much so that I decided to start over from scratch.  I wiped the HD including the HD Recovery partition and installed OS X 10.6.8.  I am now in Mountain Lion and have reinstalled MS Office 2011 and loaded the main identity data from my recovered files.  I did not see any adverse log posts until I ran the first time machine backup.
    I hope someone can clear the air for me with perhaps a way to fix it.

    Thank you Baltwo.  It's a major relief to know that the sudo command is being used by an Apple app/process and not by a file that's not supposed to have it..  However a few more questions if you don't mind.
    Is the font file the suspect file or is it this particular mdworker?
    If the font file is the suspect file will a process or app that calls for it be allowed to use it?
    Which process/app/file invoked the sandbox and deny file-read-data?
    What is the role of the mdimporter?
    These questions are part of my attempt to understand how a large part of the files on my computer and Time Machine become corrupted when I first installed Mavericks.  Mainly .plist (and other plain text files), .png, jpeg (and other picture types) and pkg info bundles would have thier icons and file Kind changed to Unix Executable files, spreadssheets and doc/docx would become genrandom (or something similar).  I became aware of this when my machine began freezing up.  I made several clean reinstalls and the problems would reoccur on plugging in the Time Machine.  I eventually recovered the files I wanted from the Time Machine but I had to use another iMac with an older OS X.  I repartitioned my machine and rebuilt it to Mountain Lion and i'm in the process of reloading with what I hope are non corrupted files. Although I still see log posts like "Locum[6230]: Connection with distnoted server was invalidated" every time I paste a folder or file.  I don't know what that means but it doesn't seem to cause any further reaction or posts.
    My apologizes for bothering you with alll this and thanks for your insight.

  • File read write

    Hi guys:
    its an easy question so i will explain as simply and as elborately as possible:
    i am reading from a file
    public void appendFile() {
        try {
          BufferedReader in = new BufferedReader(new FileReader("temp\\text.txt"));
          BufferedWriter out = new BufferedWriter(new FileWriter("temp\\text.txt", true));
          String str;
          String res;
          while ( (str = in.readLine()) != null) {
            res = process(str);
            if (res != null) {
              try {
                out.write(res);
                out.close();
              catch (IOException e) {
                log.info(e.toString());
          in.close();
        catch (IOException e) {
      }what i am trying to do is : read a file read though and where i get a certain string i replace it with another string :
    no looking at this code tell me if i will be writing at the same position or not.. i dont really remember if the cursor for readline and write line is the same :
    forexample : i read through ten lines and find the string i am looking for and i write at that moment witha new strinmg:
    1) will it write on the same line and write over the text that is already written
    OR
    2) will it write on the same line and move the text on that (that i am intending to replace) line to the next..
    OR
    3) will it write in the beginning of the file

    found the error i think : in FileWriter ("",true);
    the true defind that it hould be written in the end of file ... and not the begiining
    now i will see if the flase will write to the beginning or where the readline was done...

  • File and question mark when starting

    Flashing file and question marl when i start my computer

    There are four general causes of this issue:
    1. The computer's PRAM no longer contains a valid startup disk setting when there aren't any problems with the disk itself. This can be checked for by pressing the Option key and seeing if the drive appears.
    2. The internal drive's directory structure has become damaged. This requires usage of an alternate bootable system to perform the repair.
    3. Critical system files have been deleted. This requires usage of an alternate bootable system to reinstall them.
    4. The internal drive has died or become unplugged. This is the most likely case if the computer took a sharp impact or there are unusual sounds coming from its location.
    (103563)

  • Multi-thread file reading

    Hi,
    I've got a tricky question: I have to read large files (over 150 MB) - I found here several topics about reading such a large files, but all examples were about single-threaded reading from file... Do you think, multi-threaded reading would be faster? I am in quite a dilemma: multiple threads in general means faster processing, but in this case, all threads are reading from the same source/file
    (I use javax.mail.util.SharedFileInputStream for multi-threaded file reading - each stream in separated thread)
    so what do you think, which is faster: single-thread or multiple-thread? and if so, how many threads would be fine - 2, 3 or 4?
    thanks a lot

    kvasoo wrote:
    Herko_ter_Horst wrote:
    The I/O thread processing thread(s) approach will work when the processing takes more time than the I/O (i.e. when the medium can transfer information faster than a single thread can process it).it is very likely that processing will take more time then file reading - there will be 5-7 regex to match per line, sometimes object creation and filling object fith some data
    so it seems to be just like I wrote some posts before: while one thread is reading data from file, another could process already read data - I am just considering malcolmmc's idea of blocking queue - one thread to perform I/O operations and one thread to process data - these threads would be connected through blocking queue....hmm that sounds good to me.. thanks malcolmmc
    thank you guys for your help & suggestions and if you still have something to advise me, I will be thankfulSeparation of concerns, dude. Read the raw data in, in one thread, and split out the processing to multiple threads. I really advise you take the time to actually measure the performance of the multi-threaded processing vs the single-threaded one though. I mean, really do actually do that. Don't just assume - as so many people do - that throwing more threads at every problem will always speed it up, because it's so often not the case.

  • .AVI file format question

    Upgrading from CS2 to Photoshop CS5
    I found out after the fact that in order to edit video you need CS5 Extended.
    So, I then went and returned regular and upgraded to Photoshop CS5 extended.
    (See my other thread for details, but installing the 12.01 patch is not an option at this time.)
    Try to use file open to open a .AVI file from one of my cameras and get a message of "unrecognized file format".
    Was able to import the 7 second video into layers.
    Checked support issues, and installed Quicktime 7.6.8
    Also, due to 12.01 issues, reinstalled Photoshop CS5 Extended AFTER upgraded Quicktime to 7.6.8
    Machine specs:  Toshiba Satellite P30  Intel Pentium 4 CPU 3.60 GHZ (Hyperthreading Dual Core) 2GB RAM ATI Mobility Radeon X600 Win XP Professional SP3 About 12 GB disk space available at install time.
    Note that Quicktime will open the .AVI file in question with no problems, as well as Roxio software (trying to get rid of that with CS5)

    I talked to support via phone and it appears the the problem is in installation.  The install of CS5 extended did not take over the regular install.  So, I need to start by completely uninstalling AGAIN and installed extended from scratch AGAIN.
    I did try the program mention GSPOT as well.  It says AVI codecs are installed on the machine inquestion.  I will get more informaiton tonight afte rI do the re-install and see what happens.

Maybe you are looking for