System call questions

I need to determine the number of lines of a file given by a line parameter, using the wc command ... any clue anyone???
Thank you

See the Runtime class.
http://java.sun.com/j2se/1.5.0/docs/api/index.html
Also see the "gotchas" of using that class.
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Similar Messages

  • System call

    1) how can i make a system call question in Java.
    2) I have to determine the size of a dir by using du...
    the first topic is the important stuff but i wouldn't mind some help on the second either ...

    1) how can i make a system call question in Java. A "system call question", you say? If you mean how can you execute an external process: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html
    >
    2) I have to determine the size of a dir by using
    du...Using "du..."?
    http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html

  • Quick question about making system calls

    hello all
    i have a simple quick question regarding making system calls. Basically I want to mimic the command "system" for perl. I am not quite sure how to do this for java.
    any feedback would be appreciated.

    look at:
    java.lang.RunTime

  • System call module questions.

    Hello,
    I am trying to create a system call module for solaris 2.6 (sparc).
    I am trying to avoid useing the /etc/name_to_sysnum file because I dont want my system calls to be dependant on a userland file. What I have done is this.
    static struct modlmisc modlmisc = {
    &mod_miscops,
    "Einstien system call driver"
    static struct modlinkage modlinkage = {
    MODREV_1,
    &modlmisc,
    NULL
    int
    _init(void)
    int error;
    if ((error = mod_install(&modlinkage)) < 0)
    return error;
    sysent[SYS_secctl].sy_narg = 6;
    sysent[SYS_secctl].sy_callc = (longlong_t (*)()) test;
    sysent[SYS_secctl].sy_flags = SE_LOADED | SE_NOUNLOAD | SE_ARGC;
         return 0;
    And this works, the only side effect is that my system calls do not have return values. Is there something else that I need to do (without makeing a specfic system call driver that depends on /etc/name_to_sysnum) to have correct return values ?

    See the Runtime class.
    http://java.sun.com/j2se/1.5.0/docs/api/index.html
    Also see the "gotchas" of using that class.
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Unity Connection 9.1 - System Call Handler Question

    Hi,
    I would like to use Unity Conncetion 9.1 to transfer calls to different extensions depending on the time of day:
    For example; between 07.00 and 19.00, do not play a greeting and transfer to an extension (no mailbox), outside of the times above, again do not play a greeting and transfer to a different extension.
    I have configured a CTI RP and set the extension to forward all to VM. The system call handler has an active schedule of 07.00-19.00 and has a standard transfer rule set up to transfer the calls to the relevant extension. I have also configured a closed transfer rule to transfer the call to the alternative extension after 19.00. The issue I have is that when dial the original extension I get the standard greeting. How do i get Unity to transfer the call without playing the greeting?
    Thanks,
    Phil

    Hi Phil,
    You need to:
    1) enable the closed greeting
    2) set the standard and closed greetings to "callers hear nothing"
    3) in the standard and closed greetings, after the greeting, set it to call handler, select the same call handler, and set it to attempt transfer.
    4) make sure the standard and closed transfer rules are enabled, set the respective extensions to transfer to, set them to release to switch, and uncheck "Play the 'Wait While I Transfer Your Call' Prompt" for both of them.

  • How to use system call in assembler

    I write codes to display the dictionary using C,
    and it can run well,and then I want to use system call
    in assembler to realize the same function ,but it doesn't
    display the dictionary,how to correct it?
    Look:
    //C
    #include <stdio.h>
    int main()
    char *name[2];
    name[0]="/bin/ls";
    name[1]=NULL;
    execve(name[0],name,NULL);
    return 0;
    //Assembler
    .data
    msg:.string "/bin/ls"
    .text
    .global _start
    _start:
    movl $0xb,%eax
    movl $msg,%ebx
    mov $msg,%ecx
    movl $0,%edx
    int $0x80
    movl $1,%eax
    movl $0,%ebx
    int $0x80

    If you compile with -Wwrite-strings, as I like to do for new code, you'll notice it warns about assigning the address of read-only memory to a plain char *. You might want to declare name as follows to avoid accidentally trying to modify it:
    char const *name[2];
    But as for your question. The execve system call requires a pointer to a list (array) of pointers to strings in %ecx. You are passing it a pointer to a single string, which means it will try to interpret the string ("/bin/ls")as a series of pointers to strings, with potentially disastrous (and certainly weird) results.
    Last edited by Trent (2012-12-28 15:31:38)

  • System Call by Java Application - [change path and run of the other progra]

    public class  A {
         public static void main (String[] args)
              System.out.println("Hi");
    }I do have above A.java.
    I am generating A.class from it.
    A.class is in the following directory :
    /home/sachin/work/Sample_Directory/bin/hello_filetest/
    I have another program which makes System call.
    But the problem is B.java is in the different directory :
    /home/sachin/work/Sample_Directory/src/hello_filetest/
    public class  B {
         public static void main (String[] args) {
    Process p1 = Runtime.getRuntime().exec("java A);
                BufferedReader stdInput = new BufferedReader(new
                     InputStreamReader(p1.getInputStream()));
    while ((s = stdInput.readLine()) != null) {
                    System.out.println(s);
    {code}
            So, my question is how to change directory by system calls and execute the program
    which is lying in other directory ????
    Thank you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    The following code will call javac on a .java file, which will compile it into a .class file
         public static void javacTest() {
              JFileChooser jf = new JFileChooser();
              if (jf.showOpenDialog(null) != jf.APPROVE_OPTION) return;
              File file = jf.getSelectedFile();
              File dir = file.getParentFile();
              try {
                   Process p = Runtime.getRuntime().exec("javac " + file.getName(), null, dir);
                   IOUtils.pipe(p.getInputStream(), System.out);
                   IOUtils.pipe(p.getErrorStream(), System.out);
              catch (IOException iox) {
                   iox.printStackTrace();
         }Is that what you're trying to do, or are you trying to run the compiled (.class) file? Running your .class file should be basically the same as the above, assuming that you are not using any non j2se libraries, except that you need to take into account the package (if package is x.y, you must have file in ...src\x\y\foo.class - call "java x.y.foo" from src)

  • "The data area passed to a system call is too small" NFS client Windows 2008 R2 SP1

    Hi
    I need to map a Hyper-V virtual windows server to a UNIX folder, but when i made de mapping and tried to navigate in to the mapped unit and shows me:
    "The data area passed to a system call is too small"
    I tried too many things like adding a registry key (and windows 2008 r2 already has)
    Use a similar account between Unix and Windows domain
    I done the steps in the document:
    http://technet.microsoft.com/en-us/library/cc753302(WS.10).aspx
    And nothing, this is just frustrating, also I disabled the firewall in the virtual machine and the host server.
    I have a Windows 2008 Domain R2 functionality and the virtual machine is Windows 2008 R2 too.
    The version of unix are:
    AIX6.1  x64
    AIX 6.3 x64
    AIX 5.1  x86
    Any Idea?
    Thanks!
    Doc MX

    Hi,
    You may perform the following troubleshooting suggestions:

    Change how your NFS servers export the NFS shares and make them allow connections from high ports.

    Add UseReservedPorts DWORD value under HKLM\Software\Microsoft\Client for NFS\CurrentVersion\Default and set it to 1. Restart the Client for NFS service to allow
    the change to take effect.
    For more information, please refer to the following Microsoft MSDN blog:
    "Network Error 53", "The data area passed to a system call is too small" or "Unknown Error"
    http://blogs.msdn.com/b/sfu/archive/2011/07/14/3087987.aspx
    Regards,
    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.

  • A problem about system-call

    hi guys,
       i found in the interface IF_HTTP_ENTITY
       the method SET_HEADER_FIELD has the codes like below
       <i>system-call ict
        did
          ihttp_scid_add_header_field        " add instead of set!!!
        parameters
          m_c_msg                            " > c handle
          name                               " > header field name
          value                              " > header field value
          m_last_error.                      " < return code</i>
    i have look at the help of the system-call ,but i cant find the same help about the ICT and did
    my question is can somebody give some explanation about
    <i>system-call ict
    did
    parameter</i>
    thank you

    hi
    i just only new in BSP application,my question is why after the "system-call" we can use the parameter "did" and "ict".  
    i have just refer to the help document of the "system-call" but i can't find the information about the code
    <i>system-call ict
    did
    ihttp_scid_add_header_field " add instead of set!!!
    parameters
    m_c_msg " > c handle
    name " > header field name
    value " > header field value
    m_last_error. " < return code
    </i>
    so can you give me some explanation about this ?
    i wont do something to change them.
    thank you

  • -4006 -The data area passed to a system call is too small.

    Hi ,everybody.
    I would like to add data into SQL Server with VB.net 2005 and i am using object SAPbobsCOM.Payments with BoObjectTypes.oIncomingPayments when i build program and execute then i got error like this                 "-4006 -The data area passed to a system call is too small." and my code is .....           
      Private Sub cmdPayment_Click()
            On Error GoTo ErrorHandler
            Dim vCompany As SAPbobsCOM.Company
            'create company object
            vCompany = New SAPbobsCOM.Company
            'set paras for connection
            vCompany.CompanyDB = "TototaData"
            vCompany.Password = "acct4"
            vCompany.UserName = "acct4"
            vCompany.Server = "(local)"
            vCompany.DbUserName = "sa"
            vCompany.DbPassword = "sa"
            'connect to database server
            If (0 <> vCompany.Connect()) Then
                MsgBox("Failed to connect")
                Exit Sub
            End If
            Dim nErr As Long
            Dim errMsg As String
            'Set the object's properties
            Dim vPay As SAPbobsCOM.Payments
            vPay = vCompany.GetBusinessObject(BoObjectTypes.oIncomingPayments)
            vPay.Address = "622-7"
            vPay.ApplyVAT = 1
            vPay.CardCode = "F027-HO"
            vPay.CardName = "TMT(GATEWAY)-HO"""
            vPay.CashAccount = "288000"
            vPay.CashSum = 0 '5620.85
            vPay.CheckAccount = "280001"
            vPay.ContactPersonCode = 2
            vPay.DocCurrency = "Eur"
            vPay.DocDate = Now
            vPay.DocRate = 0
            vPay.DocTypte = 0
            vPay.HandWritten = 0
            vPay.JournalRemarks = "Incoming - D10004"
            vPay.LocalCurrency = 0
            'vPay.Printed = 0
            vPay.Reference1 = 14
            vPay.Series = 0
            'vPay.SplitTransaction = 0
            vPay.TaxDate = Now
            vPay.TransferAccount = "10100"
            vPay.TransferDate = Now
            vPay.TransferSum = 0 '
            vPay.Invoices.AppliedFC = 0
            'vPay.Invoices.AppliedSys = ""
            'start
            'vPay.Invoices.Count = 1
            vPay.Invoices.DiscountPercent = 20
            vPay.Invoices.InstallmentId = 0
            'vPay.Invoices.LinkDate = CDate("31/12/2002")
            'vPay.Invoices.PaidSum = "d"
            'vPay.Invoices.UserFields = "ddd"
            'end
            vPay.Invoices.DocEntry = 1
            vPay.Invoices.DocLine = 0
            'vPay.Invoices.DocRate = 0
            vPay.Invoices.InvoiceType = BoRcptInvTypes.it_Invoice
            'vPay.Invoices.LineNum = 0
            vPay.Invoices.SumApplied = 5031.2
            vPay.Checks.AccounttNum = "384838"
            vPay.Checks.BankCode = "CB"
            vPay.Checks.Branch = "Branch"
            vPay.Checks.CheckNumber = 3838383
            vPay.Checks.CheckSum = 4031.2
            'vPay.Checks.Currency = "Eur"
            vPay.Checks.Details = "test1"
            vPay.Checks.DueDate = CDate("31/12/2002")
            ' vPay.Checks.LineNum = 0
            vPay.Checks.Trnsfrable = 0
            Call vPay.Checks.Add()
            Call vPay.Checks.SetCurrentLine(1)
            vPay.Checks.AccounttNum = "384838"
            vPay.Checks.BankCode = "CB"
            vPay.Checks.Branch = "Branch"
            vPay.Checks.CheckNumber = "3838383"
            vPay.Checks.CheckSum = 1000
            'vPay.Checks..Currency = "EUR"
            vPay.Checks.Details = "test2"
            vPay.Checks.DueDate = Now
            'vPay.Checks.LineNum = 1
            vPay.Checks.Trnsfrable = 0
            If (vPay.Add() <> 0) Then
                MsgBox("Failed to add a payment")
            End If
            'check for errors
            Call vCompany.GetLastError(nErr, errMsg)
            If (0 <> nErr) Then
                MsgBox("Found error:" + Str(nErr) + "," + errMsg)
            Else
                MsgBox("Succeed in payment.add")
            End If
            'disconnect the company object, and release resource
            Call vCompany.Disconnect()
            vCompany = Nothing
            Exit Sub
    ErrorHandler:
            MsgBox("Exception:" + Err.Description)
        End  Sub   
    It seem when i add record by use other object such as JournalEntries.It work!!!!!
    i need all of your suggestion.Anyone who have been found this error before can help me.
    Thank you so much
    Nuttaphon(Thailand)

    Hi
    Your question is not clear.. Are you talking about crystal reports results area ?  If it is not related to crystal, please mention the tool.
    Thanks,
    Sastry

  • "The data area passed to a system call is too small." Windows 8

    I am not a developer - thus many comments do not make sense to me, as I'm just a heavy user. Today, about a year and half after beginning to use Windows 8, hyperlinks in my emails return the error "The data area passed to a system call is too small."
    Can you give a layperson (i.e. simple - is it fixable and can I fix it?) answer to this error? If I copy and paste the URL into my IE 10 browser, it works. However, this takes more time than I usually can afford given how often I use email links to continue
    my work.
    Here's a picture of the error message:
    OOPS, just got big RED message: Body text cannot contain images or links until we are able to verify your account.
    I seem to have one (logged in automatically as sunwalkermsdn).
    Thanks for any help to this newly appearing issue.
    (will I get an email if you post an answer? - due to same message above, I cannot enter my email address)

    This is a developer forum. We cannot help you to fix a web site, unless you own the web site in question and you can release a fix by yourself if you just need some advise on web development.
    Contact the web site's owner if you don't own the web site in question. 
    Visual C++ MVP

  • Operating system calls from apex

    Question about operating system calls from apex.
    I created a java file which is wrapped with pl/sql like
    create or replace java source named "ExternalCall" as
    import java.io.*;
    I do the steps from this web page http://www.oracle.com/global/de/community/tipps/oscalls/index.html
    The page is in german, but for experienced users the code on this page says everything.
    In apex i have an application which calls this function with the "move" command in a sql-report region.
    Let's say move c:\work1\file.txt c:\work2\file.txt
    Everything works fine on one host(pc) but if i want to transfer the file from my host to another one then
    i get the messgage "no access" although i have read, write access on the other host.
    By the way, on both hosts i have admin rights.
    Why can't i transfer the file over a network ?
    Thanks in advance for any kind of help.
    Regards
    Stefan
    null

    You say that "on both hosts i have admin rights".
    Remember that Oracle doesn't log in as "you", so Oracle may not have rights to the remote host.
    There are a lot of different permissions that can be assigned to java stored procedures. This chapter in the documentation might help:
    http://download-east.oracle.com/docs/cd/B19306_01/java.102/b14187/chnine.htm#BABFBDGG
    You might get better help from the JVM forum:
    Java in the Oracle Database

  • Operating System Calls from APEX with Java and PL/SQL

    Question about operating system calls from apex.
    I created a java file which is wrapped with pl/sql like
    create or replace java source named "ExternalCall" as
    import java.io.*;
    I do the steps from this web page http://www.oracle.com/global/de/community/tipps/oscalls/index.html
    The page is in german, but for experienced users the code on this page says everything.
    In apex i have an application which calls this function with the "move" command in a sql-report region.
    Let's say move c:\work1\file.txt c:\work2\file.txt
    Everything works fine on one host(pc) but if i want to transfer the file from my host to another one then
    i get the messgage "no access" although i have read, write access on the other host.
    By the way, on both hosts i have admin rights.
    Why can't i transfer the file over a network ?
    Thanks in advance for any kind of help.
    Regards
    Stefan

    I guess you are working on a Windows host. In this case Oracle processes are running as Windows services with a build-in MS system account. This account has no access to network ressources. You have two ways to get out of your windows box:
    Assign Oracle services a network enabled account, e.g. domain user with local administrator privileges. (I never tried this and I don't like to recommend it.)
    Use a command script for copying files and use explicite authentication within this script:-
    net use \\myserver\ipc$ tiger /user:scott
    copy c:\temp\xxx1 \\myserver\share\temp
    copy c:\temp\xxx2 \\myserver\share\temp
    Michael

  • Call gate for systems call

    Hi all,
    On solaris-x86 The /usr/include/sys/segment.h file has the following user selectors
    /* user selectors */
    #define USER_CS 0x17 /* user's code segment */
    #define USER_DS 0x1F /* user's data segment */
    #define USER_SCALL 0x07 /* call gate for system calls */
    #define USER_SIGCALL 0x0F /* call gate for sigreturn */
    #define USER_ALTSCALL 0x27 /* alternate call gate for system calls */
    #define USER_ALTSIGCLEAN 0x2F /* alternate call gate for sigreturn */
    USER_SCALL(0x07) and USER_ALTSCALL(0x27) are both used as call gates for system calls in ld.so and libc.so(primarily 0x27 but 0x07 is used once). A static executable seems to use 0x07 exclusively. My question is whether there is any difference between the 2 call gates ? The system call semantics seem to be the same for both(syscall no goes in %eax and followed by lcall <call-gate>, 0x00). Can I substitute one for the other and will the executable still run ok ?
    Thanks
    Naveen

    Hi Michael,
    first of all the connection to an ABAP system via portal system object as you have used it in VC7.0 should also work in VC7.1. Maybe there is an issue with your configuration. There is also another option to setup the connection via RFC connection in the SAP NetWeaver Administrator. Anyway I suggest that you try to establish a connection via RFC, which is described in the [Wiki|https://www.sdn.sap.com/irj/scn/wiki?path=/display/vc71/rfc+destination]. If this connection will work then you should investigate why the connection via system portal system object is not working.
    Please let me know if you have success with the RFC connection.
    Best Regards,
    Marcel

  • Error during installation of ECC6- system call failed

    Dear all,
    i encounter the error as below during sap installation. its looks like the ID issue, but this id (fbqadm) is using by me to log into the windows. please help me.
    thank
    ERROR      2009-03-17 10:07:25.583 [syxxsyshlp.cpp:78]
               syslib::printOSError(const iastring &, int, DWORD, const iastring &, CMessage::eLogMessage)
    FSL-00001  System call failed. Error 1326 (Logon failure: unknown user name or bad password.
    ) in execution of system call 'LogonUser' with parameter (fbqadm, SAPFBWDEV01, *******, LOGON32_LOGON_INTERACTIVE,LOGON32_PROVIDER_DEFAULT,&hUserToken), line (1014) in file (synxccuren.cpp).
    TRACE      2009-03-17 10:07:25.813 [iaxxejsbas.hpp:408]
               handleException<ESyException>()
    Converting exception into JS Exception ESyException.
    TRACE      2009-03-17 10:07:25.813
    Function setMessageIdOfExceptionMessage: modlib.jslib.caughtException

    problem fix after reboot the server

Maybe you are looking for

  • Missing information in Excel but showing in PDF and HTML

    Hi all, When i am generating my report in HTML or PDF, it is showing all the information but when i am generating the same report in Excel some information are not appearing. Any Ideas? Thanks,

  • How can I manage two different accounts on itunes

    Ok both my husband and I have Ipod touched (he also has an iphone). My issue is with Itunes.... I do not want his music sync'd on my ipod as im sure he does not want mine on his. However, if I delete any songs from my account it automatically deletes

  • How to get hp printer to print in color

    how do i get my hp photosmart c4795 to print in color from my mac book pro ?

  • Installation issue with a mounted cluster resource

    Hello given: SC 3.1 9/04 on Solaris 9 sparc we run RSA Authentication Manager 6.0 on a 2 node cluster. This is installed into /opt/ace - which is a storage cluster resource. It's the fact that if I install the ACE into /opt/ace, then I take the stora

  • Problem in Selection Screen for Bex

    Hi All, I am encountering a surprising scenario. One query that we had developed is working from my id. But from one user in the selection screen two characteristics are not being shown, Yet in the spreadsheet it shows that it has put restrictions on