file

How to test for valid file name in Mac OS X

Anyone know how to test if a string is a valid file name in Mac OS X, other than trying to create file with that name? The issue I'm having is that sometimes, a file name can be too large. OSX has a byte limit for filenames and with unicode characters you can't just check the length of the string since they can be more than 1 byte. ...

file input retry

I want to input a file into an array, and if the file doesn't exist, the program exits. I have a lot of stuff to input from the command line, and if I make a typo the program exits and I have to enter it all again. How can I create an error message that keeps the program running, and lets me retry typing the file name right. FILE *fp; ...

Script to open newest image (latest timestamp) in XP?

Hello- I need some type of script or command that when triggered, opens up the most recent timestamped .jpg file within a specific folder ex: c:\images I will use autohotkey to call the script/command (AHK may even be able to execute for all I know) at specific intervals. Any help appreciated. Thanks! ...

Is there any conceivable way in which a .java file could cause harm?

Is there any way in which .java files on a web server, that are linked via a tag, could possibly, conceivably, cause damage anywhere -- on the server or client machine? I don't see how on Earth that could possibly happen -- we're talking about an ASCII text file and an anchor tag, but I have been dealing with an IT person who will no...

Stream File to a Windows Service.

Hi, I have a windows service that needs to send an attachment through email. This service does not have access to the file location. So, I need to write something that the windows service will call and get the file stream from. What is the best approach to accomplish this. I have tried creating a webservice that will write the strea...

is it possible to convert exe file to VB Project?

i lost my VB6 Project source files accidentally. but i have the executable files. is it possible to convert the exe files to VB Projects? is there any opensource/free decompiler available? ...

Swapping a running jar at runtime

I am building an update system in which I need to be able to replace a referenced jar of a running application jar at runtime. I am finding I am running into file locking issues on Windows when trying to perform file utility functions on the jar such as 'setLastModified'. After some googling I found this snippet... What I found in m...

In PHP, after assigning a file pointer resource to a variable with fopen(), how can I get the file name from the variable?

For example: $file = fopen("File.txt", "r"); $filename = $file->basename; if there was a method like basename for file objects (file pointer resources). ...

html type = file

With a html type=file, how can I tell if file was uploaded. Is there something in the $_POST values to indicate so? <form action="program" enctype="multipart/form-data" method="post"> <input type="text" name="textline" size="30"> <input type="file" name="datafile"> <input type="submit" value="Send"> </form> ...

html javascript type=file

With a html type=file, how can I validate to determine if a file was uploaded, (for client side validation using javascript or jquery) <form action="program" enctype="multipart/form-data" method="post"> <input type="text" name="textline" size="30"> <input type="file" name="datafile"> <input type="submit" value="Send"> </form> <script> ...

File Packager instead of installer?

I have a problem and what I think is the solution. I feel that my solution is not new but don't know of any that have solved the problem the way I would like to. I write custom websites that integrate with an off the shelf cross media platform. We have three installs of this platform. Dev, staging and production. Nothing surprising here...

android how to save an object to file ?

Does someone know how to save and restore an object to a file on android ? ...

android what is wrong with openFileOutput ?

Im trying to use openFileOutput function but it doesnt want to compile... doesnt recognize de function. Im using android sdk 1.6. Is this a sdk problem ? Is this a parameter problem ? import java.io.FileOutputStream; public static void save(String filename, MyObjectClassArray[] theObjectAr) { FileOutputStream fos; try { ...

Linux (Ubuntu 9.04) permissions - how do I remove rws?

I have a directory that has rwxrwsr-x as its permissions and I need to set group to rwx. How can I do this on the command-line? I have root access. ...

Create a simple OSX Uniform Type Identifier file

How can I create a Uniform Type Identifier file for OS X with PHP? ...

How to list last changed files in one directory

Hi, if anyone hacks a site, then I would like to check which files are changed maybe in the last 24 hours in the directory htdocs, that means the files in the subdirectories form htdocs too. How to do this? I will be happy for any suggestions, Cheers Nik ...

Reading unicode character in java

I'm a bit new to java, When I assign a unicode string to String str = "\u0142o\u017Cy\u0142"; System.out.println(str); final StringBuilder stringBuilder = new StringBuilder(); InputStream inStream = new FileInputStream("C:/a.txt"); final InputStreamReader streamReader = new InputStreamReader(inStream, "UTF-8"); final Buffe...

Link keyword in TextView to file/directory

Is there any way that I can link a keyword in a TextView to a file or directory on the user's SD card? My app produces stack trace files when it crashes and I want the user to able to click a link in my About dialog to view either the latest one or the folder containing all of them. (Something like "If this app crashes, please send [link...

Bash script to extract entries form log file based on dates specified in another file?

I've got a pretty big comma-delimited CSV log file (>50000 rows, let's call it file1.csv) that looks something like this: field1,field2,MM-DD-YY HH:MM:SS,field4,field5... ... field1,field2,07-29-10 08:04:22.7,field4,field5... field1,field2,07-29-10 08:04:24.7,field4,field5... field1,field2,07-29-10 08:04:26.7,field4,field5... field1,fie...

Ruby HTTP Request

Ruby req = Net::HTTP.get_response(URI.parse('http://www.domain.com/coupons.txt')) @play = req.body req.body give me the entire page in to a string. What if I just want to read line by line? gets? Can you read line by line through a http get? Or do I just need to read a file from local? The text file looks like this 1 John Ham 25,0...