The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
implementing ftp damn_bkb IP Networking 4 01-04-2007 02:35 PM
Implementing the redirection mobile01 High Level Programming 0 11-30-2006 08:39 AM
Implementing a shell in C jacques83 High Level Programming 1 11-13-2006 07:24 PM
need help in implementing simple interactive shell in C nix1209 High Level Programming 2 03-15-2006 06:26 AM
Implementing Concatenation(cat) toughguy2handle High Level Programming 2 09-21-2005 11:10 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #8  
Old 11-13-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
Quote:
Originally Posted by ununium
Closing stdin gives me an infinite loop.
It works for everyone else. You must have a bug.
Reply With Quote
Forum Sponsor
  #9  
Old 11-13-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
Quote:
Originally Posted by ununium
Is there a way to maybe modify the file descriptor table so that I replace stdout with the file I've just opened? How would I access the file descriptor table though?
open() and close() modify the file descriptor table. No, you cannot bypass them and fiddle with the kernel tables directly.

You need to start with the basics and work your way up. You're trying to write a shell, but you're having difficulty when you open and close files. You should consider a less ambitious project until you get a little bit more experience.
Reply With Quote
  #10  
Old 11-14-2005
Registered User
 

Join Date: Nov 2005
Posts: 5
Nevermind. I figured it out for anyone who cares:

open a file
dup2(file, 1)
execute
Reply With Quote
  #11  
Old 11-14-2005
Registered User
 

Join Date: Nov 2005
Posts: 5
Quote:
Originally Posted by Perderabo
open() and close() modify the file descriptor table. No, you cannot bypass them and fiddle with the kernel tables directly.

You need to start with the basics and work your way up. You're trying to write a shell, but you're having difficulty when you open and close files. You should consider a less ambitious project until you get a little bit more experience.
PS: Thanks for false information and then insulting me.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:43 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0