How do I change directory?

How do I change directory? I mean something like "cd .."
Thanks
H.

//Author: Richard Focke :)
import java.io.*;
class RuntimeExec{
     private static boolean quit;
     public static void main(String[]args)throws IOException{
          if(args.length<1){
               System.out.println("Type in program to run");
               System.exit(1);
          quit = false;
          Runtime run = Runtime.getRuntime();
          Process newProcess = run.exec(args[0]);
          if(newProcess!=null){
               BufferedReader  br = new BufferedReader(new InputStreamReader(newProcess.getInputStream()));
               PrintWriter os = new PrintWriter(newProcess.getOutputStream());
               BufferedReader  be = new BufferedReader(new InputStreamReader(newProcess.getErrorStream()));
               if(br!=null)(new ReadThread(br)).start();
               if(os!=null)(new WriteThread(os)).start();
               if(be!=null)(new ErrorThread(be)).start();
               try{
                    newProcess.waitFor();
               }catch(InterruptedException ie){}
          }else
               System.out.println("Error creating process");
          newProcess.destroy();
          quit = true;
          System.out.println("Done!");
          System.exit(0);     
     private static class ReadThread extends Thread{
          private BufferedReader is;
          public ReadThread(BufferedReader is){
               this.is = is;
          public void run(){
               String s;
               while(!quit){
                    try{
                         s=is.readLine();
                         if(s!=null)
                         System.out.println(s);
                    }catch(IOException e){}
     private static class WriteThread extends Thread{
          private PrintWriter br;
          private BufferedReader ss;
          public WriteThread(PrintWriter br){
               this.br = br;
               ss = new BufferedReader(new InputStreamReader(System.in));
          public void run(){
               String s;
               while(!quit){
                    try{
                         s=ss.readLine();
                         if(s!=null)
                         br.println(s);
                    }catch(IOException e){}
     private static class ErrorThread extends Thread{
          private BufferedReader br;
          public ErrorThread(BufferedReader br){
               this.br = br;
          public void run(){
               while(!quit){
                    String s;
                    try{
                         s=br.readLine();
                         if(s!=null)
                         System.err.println(s);
                    }catch(IOException e){}
}

Similar Messages

  • How can I change the name of my home directory?

    When I first set up my Macbook Pro a year ago, I put my first and last name. I didn't like this and later changed the login name to just my first name, but the "home" directory is still listed as my full name on the side panel in Finder windows. How can I change this, it won't let me rename that.

    Barney-15E wrote:
    You should have experienced that same effect when you managed to change you login name. How did you change your login name?
    I imagine that has something to do with why everything 'disappeared' when you changed the directory name.
    It's actually pretty simple to change the login name, and it doesn't affect files at all.
    All I did was change the field labeled "user name".
    Niel wrote:
    Move all of your files to the other home folder in the Users folder and then change the name.
    (38519)
    I'll try that, thanks.

  • How can I change my "Home directory" folder name?

    Hello, everyone.
    I was given a pre-owned MacBook Pro that's running OS 10.6.8.  How can I change the name on the Home directory folder?  I was able to change the Administrator Account settings, but the Home directory still shows the previous owner's name.  It bothers me a bit, though, to see the previous owner's name still come up on the Home folder.
    I came across the instruction listed below, but I can't get past step 4.  It instructs me "rename it just like I would rename any folder."  I can't seem to rename it, though.  The cursor doesn't come up when I click on the folder name.
    For Mac OS X v10.5 or later
    Enable the root user.
    Log in as root.
    Navigate to the /Users folder.
    Select the Home folder with the short name you want to change, and rename it just like you would rename any folder. Keep in mind that the shortname must be all lowercase, with no spaces, and only contain letters.
    Use the Users & Groups pane (Accounts pane in Mac OS X v10.6.8 or earlier) in System Preferences to create a new user with the Account name or Short Name that you used in the previous step.
    Click OK when "A folder in the Users folder already has the name 'account name'. Would you like to use that folder as the Home folder for this user account?" appears. Note: This will correct the ownership of all files in the Home folder, and avoid permissions issues with the contents.
    Choose Log Out from the Apple menu.
    Log in as the newly created user. You should be able to access all of your original files (on the desktop, in Documents, and in the other folders of this Home).
    After verifying that your data is as expected, you can delete the original user account via the Users & Groups pane (Accounts pane in Mac OS X v10.6.8 or earlier).
    Disable the root user.
    Any help would be much appreciated.

    Hi everyone,
    I followed this https://discussions.apple.com/docs/DOC-3872
    and got to the stage of having renamed my Home folder with the new name but the Home folder is STILL designated to the old name?
    When I try and create a new user with the new name, I don't get asked if I'd like to use the existing name as Home folder, I get told I can't use the newname because it exists already - thats the end of it - no further options.
    So to clarify - I now have oldname folder STILL assigned as Home folder. A newname folder with all my stuff in - apps, desktop, etc etc but this is just another user folder.
    Interestingly at login stage, the oldname folder isn't an option. I think I've confused the system somewhere by titling things differently at some stage in an attempt to rename Home folder.
    I'm running Mountain Lion (as of yesterday) and because I've kinda lost the use of my User folder as the Home folder, can't get to my Time Machine. I'm in trouble but I'm trying not to panic. Would appreciate any help!
    Laurie

  • How do I change my default "SAP Working Directory" to the one I wish ?

    Hello Gurus,
    How do I change my default "SAP Working Directory" to the one I wish ?
    At the moment default SAP Working Directory to set to the following directory.
    "C:\Documents and Settings\T51273\SapWorkDir"
    So, when ever I try to download a Report/Table Contents/Spool Request, SAP prompts me to save in the above SAP Working Directory, which is "C:\Documents and Settings\T51273\SapWorkDir". Ofcourse I can change the folder in the dialogue box, but I don't want to change the folder each and every time I download a report from SAP.
    I wish to change my default "SAP Working Directory" to "My Documents" Folder. So that from next time,
    if ever I try to download a Report/Table Contents/Spool Request, SAP should prompt "My Documents" Folder. That way I don't have to change the folder at the time of saving.
    Full Points are assigned for an answer that works...
    Thank You,
    Nag.

    Hello,
    A short question about transaction SO21:
    Is this a local setting, per GUI?
    Or does this affect all users?
    I have a problem opening an attachment (Mandates).
    SAP wants to save it to C:\Windows\System32\
    I see that is stated at SO21.
    If I change that to another (accessable) location, does that affect the opening of the attachment?
    Thanks!

  • How do you change the directory location from the hieachy window.

    Our DAQ system consists of 285 vi's. During development changes, some vi's were created and passed to the DAQ via a LAN connection. Pulling up the vi's at the DAQ has changed the desired path such that some come from the LAN virtual drive, while others are resident on the DAQ PC. All have been copied to the PC's hard drive. Viewing the LabView hiearchy, how do I change the directory for a few individual vi's to point at only the PC harddrive? I saw this done once, but forgot how and cannot easy find it in the help files.

    When this happens to me I temporarily disconnect the network drive or rename the network folder to force LabVIEW to do a search. If they're all in the same folder as the main VI, they'll be found automatically.

  • How to repair Open Directory Master after Changing Hostname

    Summary:
    How to repair Open Directory after Changing your Server's Hostname (see separate post)
    Problem:
    I had to change our server's hostname from a private hostname (server.name.private) to a public hostname (name.dyndns.org).
    Procedure:
    1. Precautions:
    Since I was anticipating major dramas I tested the change of hostname on a clone ( I used Super Duper, and I very strongly advise everybody to heed this warning because a change of hostname will corrupt your server services, in particular Open Directory)
    Second, I exported the network users from Server Admin and copied the archive to the Drop Folder of the server's local account (because the network accounts will be unavailable after demoting the OD Master.)
    2. Change hostname and demote OD Master
    a) I re-booted the server from the clone
    b) I changed the hostname in Server App and I noticed that the Open Directory Password and the Kerberos database were still stuck with the old hostname.
    c)  I then demoted to a standalone directory (Server Admin) and I tried to promote the server to an OD Master using the Server App (Manage Network Accounts). Server App always returned an error saying I should check my network settings.
    3. List of 'fixes'
    I tried the following fixes to no avail (which does not mean that you can skip them)
    a) I checked the DNS entries, forward and reverse were working fine (sudo checkip -changehostname)
    b) Checked with Lookup in Network Utility, all was fine
    c) I deleted all system certificates (Keychain) which showed the name of the previous hostname
    ( N.B. you need not delete email certificate and private/public keys)
    d) I tried to assign a new static IP in Networking Preferences (had no visible result)
    e) I re-booted from the working drive and I re-paired permissions on the clone; I ran disk repairs.
    Despite all this I could not re-create an OD Master.
    I then looked for this dubious folder /var/root/Library/Application Support/Certificate Authority.
    I could not find this folder when using the Finder's Go To Folder, nor did "Easy Find" see this folder.
    I was about to give up when I read the posts on this page and I entered the Terminal commands
    sudo rm -R /var/root/Library/Application\ Support/Certificate\ Authority/
    I had not much hope when I set about to re-create the OD Master from the Server App.
    But lo and behold !!! I did not trust my eyes when Server App claimed that the OD Master had been successfully created. And indeed, Server admin showed a running OD Master, LDAP, Kerberos and Password Server all running again !
    Final touch: re-import the user accounts.
    Epilogue:
    I woud not have been able to fix this issue had not so many others shared their experience and the working solution.
    (Refer : https://discussions.apple.com/thread/3219325?start=0&tstart=0 )
    Thank you all !
    Let's hope that Apple will fix this annoying issue in the next server update.
    Regards,
    Twistan

    Hi Rhyan,
    Please try clearing the security cache
    http://www.sharepointanalysthq.com/2014/05/active-directory-groups-and-sharepoint-security/
    https://sergeluca.wordpress.com/2013/07/06/sharepoint-2013-use-ag-groups-yes-butdont-forget-the-security-token-caching-logontokencacheexpirationwindow-and-windowstokenlifetime/
    http://webactivedirectory.com/active-directory/windows-active-directory-cached-user-credentials/
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How to change directory in Terminal (ex. cd System HD)

    hi
    how to change directory in Terminal (ex. cd System HD)
    i wrote cd system hd, which did not work. Terminal understood it as cd system.
    is there some character to write a "space" between words?
    thanks

    You need to escape the spaces with a leading backslash or the shell will give you unexpected results.
    For example to cd to "folder with spaces"
    cd folder\ with\ spaces/
    Also, the bash tab-auto-complete is your friend. Type a character or two and then tab, you'll get the idea when you see the result. If there is more than one possible completion, then hit tab a couple of times quickly and you'll get a list of all of the options.
    hth

  • How can I change the directory a file is written to?

    Hi,
    I have an app running through JSP. At one point in the app, a file is written to the current directory. I have installed Tomcat at "C:\Program Files\Apache Tomcat 4.0" but the file is written to "C:\Documents and Settings\Administrator\Start Menu\Programs\Apache Tomcat 4.0" !!!
    What gives? Anyone know how I can change this?
    I also need to be able to read files from the current directory, so I can't really put them in that dir... I would like to be able to store the files in a dir relative to the webapps/myapp dir...
    I searched through the archives for this problem without finding a solution...
    Please don't suggest writing the files to an absolute pathname...
    Thanks.

    To store files in a dir relative to web application context (webapps/myApplication/...), I usually use the getRealPath() method of ServletContext object.
    For example, if my filepath is "webbapps/MyApplication/MyDir/MyFileName" i do something like this:
    String FilePath=getServletContext().getRealPath("MyDir/MyFileName");
    File file=new File(FilePath);
    This way allows your application to be indipendent from local mappings inwhich it's deployed.
    Sorry for my bad english, I hope you know what I mean!!!

  • How can I change the source directory in Netbeans

    Hi there,
    Thanks for reading.
    How can I change the source directory in Netbeans so I can have a src directory?
    Thanks,
    Lorenzo

    Forgot to say Netbeans 3.6.
    thanks

  • How do I change home directory name?

    In FINDER, the home directory name is from an old employee. How can I change it?

    Log out and then into a different user account, or create one from System Preferences. If so desired, control-click the account in the Accounts or Users & Groups pane of System Preferences, choose Advanced Options, and change the name and home properties; if the computer happens to be running Mac OS X 10.4, the instructions are significantly different.
    (71132)

  • How can i change the directory permissions?

    my xampp htdocs directory does not include me as a user but has Nobody? how can i change the directory permissions because i cannot edit a file?
    Thank you

    Select the directory, CMD+I, go to the bottom, unlock the lock, and add yourself to the list with R&W permissions.

  • How do I change the "Default Directory" or default subscription when I log into the portal?

    When I login to the Windows Azure portal it redirects me to a URL like:
    https://manage.windowsazure.com/@{SomeOneElsesAccount}hotmail.onmicrosoft.com?whr=live.com#Workspaces/All/dashboard
    If I look at the URL I can see the email of a friend's account not mine.
    If I click on the Subscription drop down his account is listed as the "Default Directory" even though I no longer have access.
    How do I remove his account/subscription/directory from my account?
    How do I change my subscription as the default, so that when I login the URL is more like: https://manage.windowsazure.com/@{my email}.onmicrosoft.com#Workspaces/All/dashboard
    I have also
    asked this here...
    See the image below.  The one listed as "default directory" I no longer have access to.

    Hi Gary,
    Did you use the organizational accounts ? I guess your login account was added by "SomeOneElsesAccount" . When we used azure AD account to logging into portal, the url show the "SomeOneElsesAccount" message on the portal. If you didn't
    show other user message, I suggest you could use Microsoft account to login. Also, I suggest you read this document (http://msdn.microsoft.com/en-us/library/windowsazure/hh531793.aspx )
    firstly.
    Any question, please let me know.
    Thanks
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do I change the extension directory?

    I installed JBuilder and it changed my extension directory from the default:
    JAVA_HOME\jre\lib\ext
    to:
    JBuilder8\jdk1.4\jre\lib\ext
    how do I change it back?

    nevermind, found a solution:
    uninstall the jdk and reinstall.
    it sets it back to \jre\lib\ext
    (there's still the question of how to change the extension directory arbitrarily, but i'm not going to lose sleep over it)

  • How you change directory in Java

    Can someone tell me how to change directory in java ?
    Sample code would be much appreciated.
    Thanks in advance.

    Maybe you could explain why you think you need to change the directory. Then a solution to your actual problem might appear.

  • How i can change temporary files directory on firefox 3.6.8 because my system disk has little space

    how i can change temporary files directory on firefox 3.6.8 because my system disk has little space

    In Firefox,the equivalent ofInternet Explorer temporary internet files is the cache.
    You can change the location of the cache by adding a new preference, for details see http://kb.mozillazine.org/Browser.cache.disk.parent_directory
    If you are not confident about adding the preference, I know of one add-on that lets you specify the path of the cache. [https://addons.mozilla.org/en-US/firefox/addon/13288/ Super Tab Mode] is an add-on that enhances Firefox tab handling, but also has a section for changing the location of the cache

Maybe you are looking for