file

PHP File Downloading Questions

Hey All! I am currently running into some problems with user's downloading a file stored on my server. I have code set up to auto download a file once the user hits the download button. It is working for all files, but when the size get's larger than 30 MB it is having issues. Is there a limit on user download? Also, I have supplied my ...

stdio's remove() not always deleting on time.

For a particular piece of homework, I'm implementing a basic data storage system using sequential files under standard C, which cannot load more than 1 record at a time. So, the basic part is creating a new file where the results of whatever we do with the original records are stored. The previous file's renamed, and a new one under the ...

python file manipulation

I have a directory /tmp/dir with two types of file names /tmp/dir/abc-something-server.log /tmp/dir/xyz-something-server.log .. .. and /tmp/dir/something-client.log I need append a few lines (these lines are constant) to files end with "client.log" line 1 line 2 line 3 line 4 append thes...

How to Import a CSV file containing multiple sections into R?

I want to import the contents of a csv file into R, the csv file contains multiple sections of data vertically, seperated by blank lines and asterisks. For example ******************************************************** * SAMPLE DATA ****************************************** ******************************************************** Na...

get contents of php file after it's ran/executed

how can i put the result of an include into a php variable? I tried file_get_contents but it gave me the actual php code, whereas I want whats echoed. ...

Xcode won't let go a resource file

Hello everybody, My question today is about how Xcode deals with resource files in the app bundle which it creates. I know that it may be trivial, but I can't find an easy way out. Basically my problem is that Xcode seems to keep on including a resource file (eg a text file) in the app bundle even if the file has been removed from the pr...

Android - store .txt filenames in array

Hello! I would like to store only .txt filenames from a specific dir (let's say: /sdcard/docs/) into an String array. Example: In /sdcard/docs/ there are 5 files: 'foo.txt', 'bar.jpg', 'foofoo.txt', 'loool.png' and 'foobar.txt'. I would like to get array with contents: "foo.txt", "foofoo.txt", "foobar.txt" How could I do it? Thanks...

Specify package name and output folder from Android-generated ant build file?

I dont want to hardcode the name of the package or where it lives when building an Android project with ant. Im using the build file generated by Android. What properties contain the output folder (bin) and package name (e.g. package.apk) ? ...

Java GUI File Menu

I have a GUI with a Menu named file how do I Add a file open and close function to the program. If the program is in the encrypting mode, it should load/save the cleartext text area. If the program is in decrypting mode, it should load/save the ciphertext area. ...

How to Read Java File Structure using Java?

Hi, I'm trying to read a java file and display in console the package, class and method name. something like this: File: Test.java package tspec.test; public class Test { public void addTest () {} public void deleteTest () {} } Output: package name: tspec.test class name: Test method name: addTest deleteTest Thanks in adva...

How to read pdf, ppt, xl, doc files content into a string in php/python

Pls suggest me any inbuilt command or package? ...

External js file jquery function doesn't seem to get clientId....

I use an externel javascript file and i have this, function getdropdownvalue() { alert($("#<%=DLState.ClientID%>")); } but it doesn't seem to get my dropdown's clientId... Any suggestion... ...

How to read an image from disk and block until its read?

I'm loading 5 images from disk but I want the 1st image I read to show as soon as possible. Right now I do UIImage *img = [UIImage imageWithContentsOfFile:path]; in a for loop but since imageWithContentsOfFile:path isn't blocking all 5 images wind up getting read from disk before the first one will appear (because they're all using u...

C++ open() fails for no apparant reason

The following code: char filename[64]; ifstream input; cout << "Please enter the filename: " << endl; cin >> filename; input.open(filename); if (!input.is_open()) { cout << "Opening file " << filename << " failed." << endl; exit(1); } fails, it enters the if() and exits. What could possibly be the cause for this? I'm using ...

Detect a file is closed

Is there a simple way to detect when a file for writing is closed? I have a process that kicks out a new file every 5 seconds. I can not change the code for that process. I am writing another process to analyze the contents of each file immediately when it is created. Is there a simple way to watch a certain directory to see when a f...

Recognizing file - Python

Ok, so the title may trick you a bit, and I'm sorry for that but didn't find a better title. This question might be a bit hard to understand so I'll try my best. I have no idea how this works or if it is even possible but what I want to do is for example create a file type (lets imagine .test (in which a random file name would be rando...

Ruby: Is there a better way to iterate over multiple (big) files?

Here's what I'm doing (sorry for the variable names, I'm not using those in my code): File.open("out_file_1.txt", "w") do |out_1| File.open("out_file_2.txt", "w") do |out_2| File.open_and_process("in_file_1.txt", "r") do |in_1| File.open_and_process("in_file_2.txt", "r") do |in_2| while line_1 = in_1.gets do ...

How to remove files and directories quickly

I am using a mac. When I use the "rm" command it can only remove files. The "rmdir" command only removes empty folders. If you have a directory with files and folders with files and folders in them and so on. Is there anyway to delete all the files and folders without all the strenuous command typing? Remember, I am using the mac bash sh...

Counting unknown numbers of chars from a file in C

I'm looking for a easy way to count the unknown number of characters in a file using C language. thanks for your help ...

writing dynamic headers

I have a php dynamically generated image which I need to write to file to call later. My problem is that I need this image to have appropriate expiration headers included in it. There are a massive number of these and their headers vary individually file-by-file making .htaccess controls not an option. I can write expiration headers i...