read

Remote File Read

Hi All, How can I read a text file resides in a remote machine? There is no share exists in that machine and I am not allowed to create any share or file in the remote machine. Also I am not allowed to run any client program in the remote machine. My program is a ASP.net in C# residing in a IIS webserver. For linux machine we used ssh c...

read() from stdin doesn't ignore newline

I am using the following conditional statement to read from standard input. if ((n = read(0,buf,sizeof(buf))) != 0) When inputting data from standard input, generally the user presses enter when done. But read() considers '\n' as input too in which case n = 1 and the conditional doesn't evaluate to false. Is there a way to make the co...

How to READ and Write from the Serial Port in C#

I just start to learn How to communicate send data and receive data from my hardware through C# GUI. I already try to learn from Online but still can not understand the concept. can anyone write a detail how to READ data from serial port? Please Help Me.... ...

Read from socket: Is it guaranteed to at least get x bytes?

I have a rare bug that seems to occur reading a socket. It seems, that during reading of data sometimes I get only 1-3 bytes of a data package that is bigger than this. As I learned from pipe-programming, there I always get at least 512 bytes as long as the sender provides enough data. Also my sender does at least transmit >= 4 Bytes ...

Blocking file-read in php?

I want to read everything from a textfile and echo it. But there might be more lines written to the text-file while I'm reading so I don't want the script to exit when it has reached the end of the file, instead I wan't it to wait forever for more lines. Is this possible in php? ...

C#: How do I read a specified line in a text file?

Given a text file, how would I go about reading an arbitrary line and nothing else in the file? Say, I have a file test.txt. How would I go about reading line number 15 in the file? All I've seen is stuff involving storing the entire text file as a String array and then using the value of the line number as the number of the String to...

create ini file, write values in PHP

I cannot find a way that easily lets me create a new file, treat it as an ini file (not php.ini or simiilar... a separate ini file for per user), and create/delete values using PHP. PHP seems to offer no easy way to create an ini file and read/write/delete values. So far, it's all just "read" - nothing about creating entries or manipulat...

How can you read text files?

Hey guys, How do you read text files in objective c? I just need the coding. Thanxs. ...

Reading data from MSMQ and marking it as read

We are using MSMQ to store an object. The client application (which is asp.net UI) reads data from the queue. We have 2 cases which i think .Net MessageQueue does not support directly Case 1: When the object is read from the queue. We need to do some processing on the object. If the processing fails (this will happen if the user ...

Reading ints from file with C

Hello. This is a very simple question, but I can't seem to find something about it in here already. I want to read two integers from a file with C. My code now is this: int main() { FILE *fp; int s[80]; int t; if((fp=fopen("numbers", "r")) == NULL) { printf("Cannot open file.\n"); } else { fscanf(fp,...

How to read Excel file in c# by connection string?

Hi How to read the excel file and show its data in grid view ? I tried the ODBC provider its working but, it is happening win "Dns=EXCELF", how it will possible with connection sring ? I generate my Excel sheet connection string as : Provider=MSDASQL.1;Persist Security Info=False;User ID=admin;Data Source=Excel Files;Initial Catalog=D:\...

how to get number of rows using SqlDataReader in C#

Hi, my question is about how to get number of rows using SqlDataReader in C#. I've seen some answers around the net about this but none were clearly defined except for one that states to do a while loop with Read() method and increment a counter. My problem is that I am trying to fill a multi-dimensional array with the first row being t...

Serving file download with python

Hey gang, I'm trying to convert a legacy php script over to python and not having much luck. The intent of the script is to serve up a file while concealing it's origin. Here's what's working in php: <?php $filepath = "foo.mp3"; $filesize = filesize($filepath); header("Pragma: no-cache"); header("Expires: 0"); header("Cache-Control:...

Java concurrency file system

Good day, I need to create a File System Manager (more or less) which can read or write data to files. My problem is how do I handle concurrency? I can do something like public class FileSystemManager { private ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); public byte[] read(String path) { readWriteLo...

Why does read of /proc/cpuinfo seem to not advance file position?

I have the following code which ends up forever reading '/proc/cpuinfo' as it keeps getting the same result every read. Why doesn't the file pointer get advanced and reach eof ever? Seems this special file has different semantics. const int bufSize = 4096; char buf[bufSize + 1]; const string cpuInfo = "/proc/cpuinfo"; int cpuF...

Read Excel File Data From HttpPostedFileBase object

Uploaded Excel file Is In HttpPostedFileBase object HttpPostedFileBase hpf = Request.Files["ExcelFileeUploader"]; Want To Read Excel Data From This Object. thanks. ...

Read only a portion of a file from disk in objective-c

I am reading a very large file using a NSInputStreamer and sending them to a device in packets. If the receiver does not get a packet, I can send back to the sender with a packet number, representing the starting location in bytes of the packet missing. I know an NSInputStreamer cannot rewind and grab the packet, but is there another w...

c read a file's permissions

I have a relatively trivial question. How can I check if a file has read permissions in C? thanks ...

All possible ways to read a file from a remote server

Hello, i want to provide most possible flexibility for my script and so i need all possible ways in php and javascript to read the content(not sourcecode) of a php file from a remote server. so far i found curl, fopen and include for php and none for javascript, but i dont even know if this is possible with javascript. Thanks for any hin...

how to assign read only privileges to a user in my oracle database

Hi, I need to open up my database to a remote QA team.I want to ensure that they have read-only access to all my database objects (table records,procs, functions, views,etc) . But they should not be able to delete or drop database objects. How do i do that in oracle 10.2g ? Is there a built-in role which can be assigned to the user ...