files

Easiest point-multipoint data distribution library/framework in Java

I have a table in a central database that gets constantly appended to. I want to batch these appends every couple of minutes and have them sent to a bunch of "slave" servers. These servers will, in turn, process that data and then discard it (think distributed warehousing). Each "slave" server needs a different subset of the data and the...

Determine user/group ownership for a directory

I have a perl script that will perform some operations on directories, and I only wait it to run on directories for which the current user(e.g. the user executing the script) has ownership. I've tried the following: ... my $user = getlogin(); opendir(HANDLE, $path) or die ("No such directory: $path"); foreach my $directory (readdir HAN...

PHP form not uploading file

I have a PHP form that is inserting information into a database. It all works except for the file upload. The filename needs to get placed inside the "image" column in the database table and the file needs to be put in the directory as well. Funny thing is that this uploader was working yesterday. :-S Please can someone just review m...

C++ append to string and write to file

Why does the following code not work #include <iostream> #include <fstream> #include <stdio.h> #include <string.h> #include <stdlib.h> using namespace std; int main(){ string data; int i=0; while(i <= 5){ i++; data += i; data += "\n"; } ofstream myfile; myfile.open ("data.txt"); myfile <<...

Bash Compound Conditional, With Wildcards and File Existence Check

I've mastered the basics of Bash compound conditionals and have read a few different ways to check for file existence of a wildcard file, but this one is eluding me, so I figured I'd ask for help... I need to: 1.) Check if some file matching a pattern exists AND 2.) Check that text in a different file exists. I know there's lots of way...

Win32 Perl - Telling the difference between files and folders using a passed directory argument

Hi, I'm writing a script in perl strawberry. The first thing it needs to be able to do is take a path argument and get a directory listing for that path, and it needs to be able to distinguish between files and folders. I read some tutorials on the subject and wrote the script below, but it only works when I give it the path that the s...

How to restrict viral file sharing

So I have a website I would like to make that would essentially be selling files. For the sake of discussion let's say that these files are like the raw text of a book. If somebody buys a file from my site, there really isn't anything preventing them from sharing that unlimited amounts of times with their neighbor or whatever. I know th...

Upload sequentially a huge file to a database using a pointer

Hi, It's a requirement in my app that the users can upload files to the database. At this point, the user upload the file and the webpage save it in a temp directory, secondly the logic load the file in a Byte[] and pass this array as parameter to the "insert" SQL statement. The problem with that approach, is that if the user try to up...

How to create a form for clients to deliver files?

It's common that clients have lots of difficulty (and take a long time) to provide their files. Delivering files seems so simple, but it usually adds a bottle neck to any project. As a solution for this... My goal is to make a form that client's can use to deliver all the files needed to build their website, such as: Excel Spreadshee...

Having trouble opening a file in Java

Hello, I am trying to open this file in java and i want to know what i am doing wrong. The in file lies in the same directory as my Java file, but i tried to open this with both netbeans and eclipse and it gave a file not found exception. Can someone help me open this file and read from it. I am really new to java files. Here is the code...

Choose File Dialog

Can someone write me a complete choose file dialog? Maybe one where you can filter out all files except for ones with specific extensions? The internet needs such an example. I have not found anything lightweight enough to implement easily into on of my projects. The only other options seem to being using OI FileManger's open intents, bu...

php download file from remote server, from download url with headers set

Hi, Im trying to downlaod a file with php that is located on a remote server, and having no luck. Ive tried using fopen, get_file_contents, but nothing has worked. I am passing in a download URL, which isnt the exact file location, it is the "download url" of the file, which then forces the browser to download. So Im thinking that is ...

Copy specific File from a list to Directory & sub Directory

Friends I have alist of Files and its location, in text format, I want to copy few files to other location maintaing the Directory Tree structure.e.g below give TestFile1 under the subdirectory TestFolder3 e.g. Source File TestFolder TestFile1.txt TestFolder2 TestFile2.txt TestFolder3 TestFile1.txt TestFile3.txt Destination...

Shell script to rename files

I wrote a small shell script based on an example I found here: https://bbs.archlinux.org/viewtopic.php?id=36305 it takes this: bash-3.2$ ls test 001 test 002 test 003 test 004 and turns it into: bash-3.2$ ls 001 002 003 004 rename.sh However it gives me this error (even though it works): bash-3.2$ ./rename.sh mv: missing d...

Creating Directories to categorize the images based on its type in Java/Android?

I have to create a multiple directory like this path("images/wallpaper/flower"). It should be stored in the External Memory of the phone. How to do it? Any Idea? ...

How to convert .po to .mo files on mac?

I have tried using poedit 1.4.6>save as, but .mo is not an option. ...

removeitematpath question...

Hello, I got this app that needs to be updated with a new database. I want to remove the old one and replace it with the new. This is the code I'm using: - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (persistentStoreCoordinator != nil) { return persistentStoreCoordinator; } NSString...

Delete a record from a file?

i am using a text file to store my data records. the data is stored in the following format. Antony|9876543210 Azar|9753186420 Branda|1234567890 David|1357924680 John|6767676767 Thousands of records are stored in that file. i want to delete a particular record, say "David|1357924680". I am using C, how to delete the particular record e...

How does Perl interact with the scripts it is running?

I have a Perl script that runs a different utility (called Radmind, for those interested) that has the capability to edit the filesystem. The Perl script monitors output from this process, so it would be running throughout this whole situation. What would happen if the utility being run by the script tried to edit the script file itself...

send multiple file over TCP with C# using TcpClient

hello, im trying to send multiple file over TCP using C# TcpClient, for a single file it works great, but when i have n files, it sends only the first one, here is my code SENDING FILES try { TcpClient tcpClient = new TcpClient(); NetworkStream networkStream; FileStream fil...