file

PHP Include behaving strangely?

For some reason if i inlcude() a file deeper in the file structure to where the file calling the include() is, it works file, or if i include a file on the same level. If i try to go include('../backFile.php') it tells me there was no file? Any help :( ...

Compare file with variable list AWK

I'm stumbling over myself trying to get a seemingly simple thing accomplished. I have one file, and one newline delimited string list. File: Dat1 Loc1 Dat2 Loc1 Dat3 Loc1 Dat4 Loc2 Dat5 Loc2 My list is something like this: Dat1 Dat2 Dat3 Dat4 What I am trying to do is compare the ...

Write local file with jQuery or Javascript

I am creating a prototype that will be run in a web browser. I would like to store (and retrieve) various info submitted by a user during the use of the prototype. I know I can retrieve a variety of file formats such as xml, json... and I know I can do local storage using the plugin jstore. So I suppose I can do a convoluted solution whe...

Search for a file using Javascript

Hi, I am creating a Search functionality program, which searches a file mentioned by the user on a folder present in a Network folder through File Scripting Object. The code works fine but the problem is that, when it searches the file on the Network folder the entire HTML page gets hanged and nothing is displayed till the code has fin...

Uploading files in RESTful way?

I'm designing a RESTful API that should handle binary file uploads. Should this be done the same way as html form upload or is there a better way? ...

Python readline on a pipe that has been opened as non-blocking

I have a Linux fifo that has been opened in non-blocking mode. As expected, when I call read on the file object, it returns immediately. I use select to make sure there is no busy waiting, but that my program is still notified when there is any data available. Out of curiosity, I tried the readline function and was surprised to find that...

Ruby Convert String to File

Is it possible to convert a string to a file without writing it to disk? I would like to work ubiquitously with either a string of a file: input = "123" if (ARGV.length == 1) input = File.open(ARGV[0]) #do stuff with input Can I create a file from a string (without writing to disk)? Otherwise, I would not be able to do input.read...

File Download Not Working

When I download the original zip it works fine, but when I download it using the below headers and stuff it doesn't work. I know it's better to take this route and tell the browser how to handle the file rather than leave it up to the browser, but I can't get this to work, so I'm tempted to use a header() forward. $path = $...

Separating output by line alphabetically

I have the code below that outputs the names of files in a directory. I'd like to separate the file names alphabetically by an additional line space when the first letter of the file changes (say from A to B). Any ideas? Thanks. $dirs = scandir("Dir"); foreach($dirs as $file) { if...

Saving song/movie file to iphone from Server (with didReceiveData?)

Hi everyone, I'm trying to download a song/movie file from server that host it, and after its download to the app --> save the file to the iphone. Here is my code: - (void)applicationDidFinishLaunching:(UIApplication *)application { [self beginDownloading]; [window addSubview:viewController.view]; [window makeKeyAndVisible]; } ...

need help solving a segmentation fault with file i/o in C

I read the input file , which has 911 lines , and want to copy these 911 lines into the output file , after making a few changes to each line.. I am getting segmentation fault when i run this.. I dont know why.. can anyone please help.. #include<stdio.h> void main() { int i; FILE *fin,*fop;char* str; fin=fopen("atk561011.tx...

Java, copying file to jre

Hi, I'm trying to create a small application that will copy some .jar files into the latest jre. Is there anyway of finding out which is this path? I've looking at the File class and I've found several methods that will create an empty file, but I didn't find anything that would help me copying a file into a given path. Am I missing ...

curl --form file redirection

Hello, This works: curl --url http://someurl.tld --form "apikey=39485730" This does not: curl --url http://someurl.tld --form "apikey=<keyfile" Error: Invalid API keys The cURL manual (http://curl.haxx.se/docs/manpage.html) explicitly states -F/--form (HTTP) This lets curl emulate a filled-in form in which a user has ...

PHP: Last file in directory

How do I get the name of the last file (alphabetically) in a directory with php? Thanks. ...

Can you create an oft file in anything other than Outlook?

Can you create an oft file in anything other than Outlook? ...

What are the advantages and disadvantages of using Database over plain files?

Hi, i couldn't find the advantages and disadvantages would you please help me? thanks. ...

Attaching HTML file as email in VB 6.0

Hi, I am trying to attach an html file file to email using Visual Basic 6.0. when the cursor is comes on Open strFile For Binary Access Read As #hFile line it gives error "Error encoding file - Bad file name or number". Please all your help and support would be highly appreciated. Dim handleFile As Integer Dim strValue ...

iPhone: Once I have redirected NSLog to a file, how do I revert it to the console?

I'm using: #if TARGET_IPHONE_SIMULATOR == 0 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"console.log"]; freopen([logPath cStringUsingEncodin...

Parsing XML Truncates File Path

I am receiving a FileNotFoundException with the following code: File dataFile = new File("\\xx.xxx.xx.xxx\PATH\TO\FILE.xml"); if(dataFile.isFile()) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); // Printing out File displays full path Document doc = db...

Silverlight file upload memory issue

Using Silverlight 3 to build a file upload app. It can upload files of just about any size - it works (depending on circumstance) with 4GB files. It uploads chunks of the files, so that if anything happens, the upload can be resumed from the most recent chunk. The circumstance where uploading does not work is in IE and Chrome when uploa...