Sponsored Content
Top Forums Shell Programming and Scripting how to open a file and read a file in UNIX Post 302541882 by zaxxon on Tuesday 26th of July 2011 05:14:53 AM
Old 07-26-2011
Are you currently participating a test? For urgent and "asap"-threads, there is an extra sub forum and classroom/homework stuff has also an extra sub forum. Best you read the The UNIX and Linux Forums - Forum Rules first and obeye them.

-closed-
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do u open a read only file in Unix?

How do u open a read only file in Unix? (1 Reply)
Discussion started by: JosephGerard
1 Replies

2. Shell Programming and Scripting

open unix file in windows

Hi, I have a text file in unix. i am trying to give a link in Internet explorer to that file. If i click on the link in Internet Explorer page then it should display the text from file in unix. is that anyway possible.... i am trying it for past 2 days....if i find a way out i will... (3 Replies)
Discussion started by: ganesh
3 Replies

3. Shell Programming and Scripting

Win32::OLE open excel file as read only

I am using Win32::OLE to write a perl script which opens an excel file. That excel file is password protected and everytime i run that script dialog box pops up and I have to click on Read-Only then my script executes. Is there any way I can specify the readonly attribute in my code so i dont have... (0 Replies)
Discussion started by: dguy
0 Replies

4. UNIX for Advanced & Expert Users

How can i read a non text file in unix - ELF-64 executable object file - IA64

The binary file is ELF-64 executable object file - IA64. How i know that the source is Is there any comamnd in unix i can read these kind of files or use a thirty party software? Thanks for your help (8 Replies)
Discussion started by: alexcol
8 Replies

5. Solaris

file open/read/write/close/access by process

Hi want to know what file (descriptor+filename+socket) is being accessed by particular process on solaris. Purpose : while running perf. test, needs to find where is the bottleneck. We are providing concurrnet load for around 1 hr and needs to capture data related to file usage pattern... (1 Reply)
Discussion started by: raxitsheth
1 Replies

6. UNIX for Dummies Questions & Answers

open windows's .url file in unix

In windows, I can create a shortcut for websites. It's a .url file. the content of the file is like: How can I open it, the .url file, in firefox or google chrome in Unix(or just ubuntu)? (2 Replies)
Discussion started by: hz_i3
2 Replies

7. Solaris

Before I delete any file in Unix, How can I check no open file handle is pointing to that file?

I know how to check if any file has a unix process using a file by looking at 'lsof <fullpath/filename>' command. I think using lsof is very expensive. Also to make it accurate we need to inlcude fullpath of the file. Is there another command that can tell if a file has a truely active... (12 Replies)
Discussion started by: kchinnam
12 Replies

8. Shell Programming and Scripting

Open a file in UNIX mode

hi, The function open(OUTPUT, ">$output_filename"); #opens the file in (DOS) windows mode. how to open the output file in unix mode. please suggest. thanks. (10 Replies)
Discussion started by: Rashid Khan
10 Replies

9. Shell Programming and Scripting

Not able to read .csv file until open in vi editor

Hi, I am facing a problem regarding .csv file, my script does not read .csv file and if i open this file in vi editor and perform :wq option then only my script reads the .csv file. Thanks (5 Replies)
Discussion started by: ranabhavish
5 Replies

10. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies
POSIX_OPENPT(3) 					     Linux Programmer's Manual						   POSIX_OPENPT(3)

NAME
posix_openpt - open a pseudoterminal device SYNOPSIS
#include <stdlib.h> #include <fcntl.h> int posix_openpt(int flags); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): posix_openpt(): _XOPEN_SOURCE >= 600 DESCRIPTION
The posix_openpt() function opens an unused pseudoterminal master device, returning a file descriptor that can be used to refer to that device. The flags argument is a bit mask that ORs together zero or more of the following flags: O_RDWR Open the device for both reading and writing. It is usual to specify this flag. O_NOCTTY Do not make this device the controlling terminal for the process. RETURN VALUE
On success, posix_openpt() returns a nonnegative file descriptor which is the lowest numbered unused descriptor. On failure, -1 is returned, and errno is set to indicate the error. ERRORS
See open(2). VERSIONS
Glibc support for posix_openpt() has been provided since version 2.2.1. CONFORMING TO
posix_openpt() is part of the UNIX 98 pseudoterminal support (see pts(4)). This function is specified in POSIX.1-2001. NOTES
The posix_openpt() function is a recent invention in POSIX. Some UNIX implementations that support System V (aka UNIX 98) pseudoterminals don't have this function, but it is easy to implement: int posix_openpt(int flags) { return open("/dev/ptmx", flags); } Calling posix_openpt() creates a pathname for the corresponding pseudoterminal slave device. The pathname of the slave device can be obtained using ptsname(3). The slave device pathname exists only as long as the master device is open. SEE ALSO
open(2), getpt(3), grantpt(3), ptsname(3), unlockpt(3), pts(4), pty(7) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2012-04-20 POSIX_OPENPT(3)
All times are GMT -4. The time now is 05:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy