Hello
In my current company, i am doing a PoC on how we can write a file downloader utility. We have to use socket programming(TCP/IP) for downloading the files. One of the requirements of the client is that a file(which will be large in size) should be transfered in chunks for example if we have a file of 5Mb size then we can have 5 th...
Hi:
I am trying to read from a file using fgets and sscanf. In my file, I have characters on each line of the while which I wish to put into a vector. So far, I have the following:
FILE *fp;
fp = fopen(filename, "r");
if(!fp)
{
fprintf(stderr, "Unable to open file %s\n", filename);
return 0;
}
// Read file
int line_...
I have an application on my server that is called leaf.exe, that haves two arguments needed to run, they are: inputfile and outputfile, that will be like this example:
pnote.exe input.pnt output.txt
They are all on the same directory as my home page file(the executable and the input file). But I need that a JavaScript could run the ap...
I need to open a file for reading and writing. If the file is not found, it should be created. It should also be treated as a binary for Windows. Can you tell me the file mode sequence I need to use for this?
I tried 'r+ab' but that doesn't create the files if they are not found.
Thanks
...
uploading multiple files from client to server with asp.net
I have been looking at the asp.net upload control but that is for one file (unless someone knows a better way to do it).
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx
For what I want to do I don't even really need a browse. I know the files...
I'm now playing with WML and WMLScript, but I'm doing a site that will have some content to download(some txt, doc, bmp, mpg, avi and jpg files), but some of my friends(that never developed in this language, just used the technology on the beginning) said that it's impossible. Then here are my questions:
It's possible?
How to do it?
...
I have an application on my server that is called leaf.exe, that haves two arguments needed to run, they are: inputfile and outputfile, that will be like this example:
pnote.exe input.pnt output.txt
The executable is at exec/, inputfile is at upload/ and outputfile is on compiled/. But I need that a PHP could run the application like ...
I am trying to write to a single file from multiple threads. The problem I'm running into is that I don't see anything being written to the file until the program exits.
...
I recently encountered an IOError writing to a file on NFS. There wasn't a disk space or permission issue, so I assume this was just a network hiccup. The obvious solution is to wrap the write in a try-except, but I was curious whether the implementation of print and write in Python make either of the following more or less likely to rai...
Which is faster between glob() and opendir(), for reading around 1-2K file(s)?
...
Our application is memory intensive and deals with reading a large number of disk files. The total load can be more than 3 GB.
There is a custom memory manager that uses memory mapped files to achieve reading of such a huge data. The files are mapped into the process memory space only when needed and with this the process memory is wel...
a='aa'
>>> f=open("key.txt","w")
>>> s=str(a)
>>> f.write(s)
and still the key.txt file remains blank .. why?
...
Has anyone ever seen an exception thrown when calling close method on any closable object?
...
I'm writing a class interface that needs to return references to binary files. Typically I would provide a reference to a file as a file path. However, I'm considering storing some of the files (such as a small thumbnail) in a database directly rather then on a file system. In this case I don't want to add the extra step of reading the t...
Consider the following 2 by 2 array:
x = {{"a b c", "1,2,3"}, {"i \"comma-heart\" you", "i \",heart\" u, too"}}
If we Export that to CSV and then Import it again we don't get the same thing back:
Import[Export["tmp.csv", d]]
Looking at tmp.csv it's clear that the Export didn't work, since the quotes are not escaped properly.
Accor...
Below is my code. My problem is, my destination file always has a lot more strings than the originating file. Then, inside the for loop, instead of using i < sizeof more, I realized that I should use i < sizeof file2 . Now my problem is, how to get the size of file2?
int i = 0;
FILE *file2 = fopen(LOG_FILE_NAME,"r");
wfstream file3 ...
I've meddled with some code but I am unable to read the entire file properly...a lot of junk gets appended to the output. How do I fix this?
// wmfParser.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "wmfParser.h"
#include <cstring>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// The one an...
In iPhone, how do you determine if a file couldn't be written to the documents area because of an out of space error?
...
shell_exec():
I'm doing a PHP site that uses a shell_exec() function like this:
$file = "upload/" . $_FILES["file"]["name"];
$output = shell_exec("leaf $file");
echo "<pre>$output</pre>";
Where leaf is a program that is located in the same directory of my script, but when I tried to run this script on the server, I just got nothing....
I need some help reading data from a txt file into my ArrayList. I know the code is pretty messy, but just try to take a look at it. The first part with the creating and putting the ArrayList into the txt file works perfectly. I just need some help at the end in the "marked" area.
Sorry if I still have some words in my native language...