files

File Attribute is read only when its folder is read only and the file is not.

Anyone has any idea?? GetFileAttributes returns 32 (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ARCHIVE). The file is C:\WINDOWS\system32\drivers\etc\hosts. Thanks a lot! ...

how to get file information / search directories

Hi! I'm wondering how do you do stuff like gettling file information, searching through directories/subdirectories in c++? Is there a particular library that I should be looking at? I'm seeing stuff like this in some examples: #include <sys/types.h> #include <sys/stat.h> Not sure where they came from.. Thanks! EDIT: I'm programming...

Saving images or pdfs in db4o

I know it is not a good thing to save files in a relational databas. But how about in a objectdatabase? Is it still a bad idea or are they more adapted for this kind of operations? ...

Is it possible to reasonably workaround an antivirus scanning the working directory?

My Win32 application performs numerous disk operations in a designated temporary folder while functioning, and seriously redesigning it is out of the question. Some clients have antivirus software that scans the same temporary directory (it simply scans everything). We tried to talk them into disabling it - it doesn't work, so it's out ...

How to push Headers from a file on an external server to download?

The following script is what I usually use to push headers to the browser so that the dialog box appears for users to download a file. However, in this case the file resides on a different server. I though this should make no difference but it does as when I execute this script with the URL of an externam MP3 file it gives me a "ERROR: ...

Why does file_get_contents take so long?

Hello all, I make an AJAX POST request to a PHP script on my server. That script in turn makes a GET request to a php script on an external server to check the contents of a text file. However, it takes a very long time to come back with a result. Why is the case? AJAX Post Request to Script on my server session_start(); $fileName = $...

Problems uploading a file in php

I am trying to upload a file to a sever using PHP. I cannot get it to work. Here is the code: if( isset($_POST['Upload']) ) { //size condition if ( $_FILES['uploaded']['size'] > 350000) { $mesg = "Your file is too large.<br>"; exit; } if( move_uploaded_file($_FILES['uploaded']['tmp_name'], "upload/" . ...

C# Binary File Compare

I'm in a situation where I want to compare two binary files. One of them is already stored on the server with a pre-calculated Crc32 in the database from when I stored it originally. I know that if the Crc is different then the files are definitely different. However, if the Crc is the same I don't know that the files are. So what I'm l...

Determining age of a file in shell script.

G'day, I need to see if a specific file is more than 58 minutes old from a sh shell script. I'm talking straight vanilla Solaris shell with some POSIX extensions it seems. I've thought of doing a touch -t YYYYMMDDHHmm.SS /var/tmp/toto where the timestamp is 58 minutes ago and then doing a find ./logs_dir \! -newer /var/tmp/toto -pr...

Grib library

Some one know a usable grib file format i/o library, i should use it on iphone ...

How can I optimize this simple PHP script?

This first script gets called several times for each user via an AJAX request. It calls another script on a different server to get the last line of a text file. It works fine, but I think there is a lot of room for improvement but I am not a very good PHP coder, so I am hoping with the help of the community I can optimize this for speed...

In-file data copy using DMA

I need to move some data from one area of a file to another. Currently, I am reading the bytes and writing them back out. But I'm wondering if doing a DMA transfer would be faster, if it is possible. I'm in C#, but unsafe and p/invoke functions are acceptable. ...

Should a directory path variable end with a trailing slash?

When defining a path to a directory as a variable or constant, should it end with a trailing slash? What is the convention? pwd in unix shows your current directory without a trailing slash, while the tab complete of cd /var/www/apps/ includes the trailing slash, which left me unsure. ...

Did I read somewhere that C++/CLI moves us towards a "header-file" less society, like Java.

And if so, should I be trying to keep header file use to a minimum when creating classes? thx ...

Get last modified and other file info from remote server with PHP

A weekly mp3 is uploaded to an external server. I manually copy this to my server and link it for podcasting and archive etc. The external file is then replaced the following week. I can copy the file directly to my server when available: copy("http://source.com/file.mp3", "newfile.mp3"); I need to know when the file is available b...

exception while Read very large file > 300 MB

Hi, My task is to open a large file in READ&WRITE mode and i need to search some portion of text in that file by searching starting and end point. Then i need to write that searched area of text to a new file and delete that portion from the original file. The above process i will do more times. So I thought that for these process, it ...

Ruby open-uri file locking

I had an issue where downloading to a local file was locking it until I killed the ruby script. On a hunch, I changed the form of the call and now it doesn't lock the file. Can someone tell me why the second form below doesn't lock the file but the first one does? This form locks the local file: open(ver_local_zip, "w+").write(open(r...

Deleting files by type in Python on Windows

I know how to delete single files, however I am lost in my implementation of how to delete all files in a directory of one type. Say the directory is \myfolder I want to delete all files that are .config files, but nothing to the other ones. How would I do this? Thanks Kindly ...

Is there a unique id for files?

I have the question http://stackoverflow.com/questions/990759/how-do-you-track-files-in-smb-with-an-application open and I was woundering whether maybe there are unique id's for files so that I can track when a file/folder is moved. Is there something like this? It can be very debian specific ...

Scan folder on local (user's) PC and upload all files(images) to web server

Hi, I wish my users could select a directory from their PC and upload all files from this directory, so they could upload whole album(directory) instead of uploading every single file separately. I would like to ask you if this is somehow possible using PHP or JavaScript and without using any framework. thank you ...