file

Network File Streaming Performance Vista

How can I achieve the best file streaming performance in Vista? My goal is to read a large file (several hundred MB) over the network directly into memory. I've allocated a memory block the same size as the file. This is also my destination buffer. I've tried ReadFile, _read, fread, ifstream::read, and boost::iostreams::mapped_file::con...

PHP: Force file download and IE, yet again

Folks, I know there have been lots of threads about forcing the download dialog to pop up, but none of the solutions worked for me yet. My app sends mail to the user's email account, notifying them that "another user sent them a message". Those messages might have links to Excel files. When the user clicks on a link in their GMail/Yaho...

Optimal lock file method

Windows has an option to open a file with exclusive access rights. Unix doesn't. In order to ensure exclusive access to some file or device, it is common practice in unix to use a lock file usually stored in the /var/lock directory. The C instruction open( "/var/lock/myLock.lock", O_RDWR | O_CREAT | O_EXCL, 0666 ) returns -1 if the l...

How to export 20 000 contacts from MySQL database via PHP for import into an desktop address book?

Hello, I need to write a script to export contact data for printing on stickers for mailing. There could be up to 20 000 records in the database table. The main problem is that the number of records could be so high and the site is hosted on a shared server and exporting the whole 20k records would, presumably, kill the script or stall....

Jboss 5 Integration with Apache 2.2

I have successfully integrated Jboss with Apache. I can pull up http://localhost/web-console .... now when I drop a war file into my Jboss deploy directory I can pull it up here localhost:8080/helloworld/hi.jsp BUT NOT here localhost/helloworld/hi.jsp Isn't the point of integrating Jboss with apache so I do not have to do :8080? and I...

Rename image files on server directory

I need some help in renaming some images in a directory located at /images/graphicsLib/. All image names in /graphicsLib/ have naming convention that looks like this: 400-60947.jpg. We call the "400" part of the file the prefix and we call the "60957" part the suffix. The entire file name we call the sku. So if you saw the contents o...

Close a FILE pointer without closing the underlying file descriptor

By using fdopen(), fileno() it's possible to open streams with existing file descriptors. However the proper way to close a file, once you've opened it with a stream is to fclose() the FILE pointer. How can one close the stream, but retain the open file descriptor? This behaviour is akin to calling fflush() and then fileno(), and then n...

SWF file displayed but xml data not loading into the swf embedded in aspx page

the flash map calls the xml external file which contains data the map shows in firefox and works a treat but wont show any of the xml data Help ...

Freeing java file handles

We have a rather large and complex application written in Java which is running on top of the Gridgain package. The problem I am having is that this application will sit there processing requests for approximately a day before every request starts resulting in an exception of type java.nio.channels.ClosedByInterruptException. My suppos...

Java NIO FileChannel versus FileOutputstream performance / usefulness

Hello, I am trying to figure out if there is any difference in performance (or advantages) when we use nio FileChannel versus normal FileInputStream/FileOuputStream to read and write files to filesystem. I observed that on my machine both perform at the same level, also many times the FileChannel way is slower. Can I please know more de...

Locking and Updating a File Accordingly

Note: I have read other posts on how to lock and unlock a file. I didn't find anything special that I wasn't aware of. So I am gonna put my scenario here so that someone can give some suggestions out. In my experience, FileChannel.lock doesn't guarantee the situation of locking and unlocking of a File when different Objects from multipl...

email file via php form

Hi friends, I researched over the internet, but could not find what i need :/ I have a contact form, (php). I dont have any database. it is a simple php email form, but now I need to make it with file attachment :/ how can I email file via contact form? visitor will browse any file from his computer and send email via form. appreciat...

file path problems with Zend Framework and fread()

Hi, I have a quick and hopefully simple question that I hope someone can help me with. I have a application that I am working on and I allow users to upload files. All files are loaded in to a directory with in the application folder of the project layout /application --/myuploadedfiles /library /public However when I need to rea...

Overhead costs of opening a file handle in PHP?

I'm writing a logging tool which writes messages to a file, and I'm not sure of the best way to deal with the file pointer. I'm tossing up between these two methods: // Open, Write, Close; Open, Write, Close... function write($message) { $fh = fopen('file.log', 'a'); fwrite($fh, $message . "\n"); fclose($fh); } // OR ----- ...

default root folder for an eclipse project

I am attempting to read a file as follows: File imgLoc = new File("Player.gif"); BufferedImage image = null; try{ image = ImageIO.read(imgLoc); } catch(Exception ex) { System.out.println("Image read error"); System.exit(1); } return image; I have a file named "Player.gif" as shown in imgLoc, but I do not know where to pu...

Delete Record from GridView AND File from server in one click

I'm trying to delete a record from Gridview1 at the same time delete the corresponding image file off the server in a single click. (Each row in Gridview1 has an associated image file on the server.) To delete the record, I'm using asp:CommandField showDeleteButton="true" along with a sqlDataSource's DELETE statement. During that pr...

jee servlet to create a file and show progress while creating it

I need to write a servlet that will return to the user a csv that holds some statistics. I know how to return just the file, but how can I do it while showing a progress bar of the file creation process? I am having trouble understanding how can I do something ajaxy to show the progress of the file creation, while creating the file at ...

Java file read problem

Hi - I have a java problem. I am trying to read a txt file which has a variable number of integers per line, and for each line I need to sum every second integer! I am using scanner to read integers, but can't work out when a line is done. Can anyone help pls? ...

Reading through file using ifstream

I am trying to read from file: The file is multiline and basically i need to go over each "word". Word being anything non space. Sample input file would be: Sample file: test 2d word 3.5 input { test 13.5 12.3 another { testing 145.4 } } So I tried something like ...

C# - Delete files from directory if filename contains a certain word

I need to check a directory to see if there are any files whos file name contains a specific keyword and if there are, to delete them. Is this possible? Example: If there are any files in "C:\Folder" whos file name contains the keyword "Apple", delete them. Thanks. ...