files

Opening Files - Cocoa

How would I be able to open files from my application? For example, they type in the directory in a textfield called "inputBox" and they press the button open, to open the file. Thanks Kevin ...

Xcode iPhone app package missing files

I'm struggling to figure out what exactly it is that decides which files go into the .app-package when compiling an application in Xcode. I've noticed that most image files go there automatically, while others like yaml-files or psd don't, and I cant find anywhere to set this. So, how do you do this? ...

Reading a remote file using Java

Hi all, I am very new to java, and have been struggling with it. I am looking for an easy way to get files that are situated on a remote server. For this I created a local ftp server on my windows xp, and now I am trying to give my test applet the following address: try { uri = new URI("ftp://localhost/myTest/test.mid"); File mid...

i want to run a file using cron job not in a browser

Hi friends, i need a help, i was set the file in cron job. that file is also execution in browser also example : http://example.com/cron.php how can i restrict in browser excution Thanks Siva kumar ...

Count number of files with certain extension in Python

I am fairly new to Python and I am trying to figure out the most efficient way to count the number of .TIF files in a particular sub-directory. Doing some searching, I found one example (I have not tested), which claimed to count all of the files in a directory: file_count = sum((len(f) for _, _, f in os.walk(myPath))) This is fine, ...

Securely enforcing user-inputted file paths within subdirectories

I know the solid security recommendation of avoiding accepting user input that you then use to choose a path to read/write a file. However, assuming you have a base directory you want to keep within (such as the root of an ftp folder), how do you best ensure that a given user input keeps us within that folder? For instance, Path.Combi...

How to use Winsock 2?

How do I use Windows Sockets 2 in Visual Studio 2008. I'm using precompiled headers, so far what I have tried is: Included winsock2.h in my StdAfx.h file and entered WS2_32.LIB as an additional dependency in Project Settings I get these errors ------ Build started: Project: TestIVR, Configuration: Debug Win32 ------ Compiling... mai...

What is the difference between File and FileInfo in C# ?

I've been reading that the static methods of the File Class are better used to perform small and few tasks on a file like checking to see if it exists and that we should use an instance of the FileInfo Class if we are going to perform many operations on a specific file. I understand this and can simply use it that way blindly but I wou...

Simple PHP AJAX File Read Progress Problems!

Okay, im not very good at describing these things, so bear with me.. Im trying to find a way of showing a status/progress bar kind of thing to show the percentage (or whatever) of how much of a text file has been read/parsed by php. I know roughly what I need to do (be it by counting the lines, or filesize and that of the actual text fi...

Nested using statements in C#

I am working on a project and have to compare two files and see if they match eachother excatly. My first draft before alot of error checking and validation came up with: DirectoryInfo di = new DirectoryInfo(Environment.CurrentDirectory + "\\TestArea\\"); FileInfo[] files = di.GetFiles(filename + ".*"); FileInfo outputFile = fil...

replacing all index.html files in a directory tree

My shared hosting account with a number of websites was compromised. Some malware on my PC, which I probably got through downloading a PDF file, found all my FTP passwords and happily went about its business of inserting some code into all index.* files on the server. I now got rid of this malware, and I am ready to change all FTP passwo...

Data files storage approach on web servers.

My web application stores product information in XML files on disk, on the web server. This is perfectly fine when it comes to a few products, however I have my worries that large amounts of files may cause problems. So let's say I'm gonna have 20,000 products, that would mean having 20,000 XML files inside a directory. I'm not familiar...

How Do I copy the files and the Folder Tree to Remote Machine?

I have two machines Server A and Server B I want to copy all the files and folder tree from Server A to Server B and create the same file and folder tree using powershell scripting I have tried the command given below but it copies only the files in the folder but do not create the folder tree Copy-Item E:\TestSource\* //TestDestinati...

Large file uploads

I'm working on an application that allows the upload, and storage of large files on a web server. Currently I'm using PHP to handle POSTed files via http. I have my php.ini set with: upload_max_filesize = 100M post_max_size = 100M memory_limit = 128M max_input_time = 6000 max_execution_time = 6000 There doesn't seem to be any apache...

File not found Exception.. But it's there

Hey this is going to be one of those dumb questions. I am trying to pick up a file on my local system and I keep getting a FileNotFoundException thrown. Someone set me straight please :) if( File.Exists(@"C:\logs\hw-healthways-prod_2009-08-26.tar")) { Console.WriteLine("Yay"); } else { ...

Fatal errorLNK2019 and LNK1120 while use LZOpenFile ?

i am Working on MS VISTA ...here i include windows.h also.... INT vint = NULL; vint = LZOpenFile(lpFileName,lpReOpenBuf,wStyle); when i compile my program ,error like, fatal error LNK2019: unresolved external symbol _LZOpenFileW@12 referenced in function "int_stdcall LZOpenFile(wchar_t *,struct _OFSTRUCT *,unsigned short)" (?LZOpenFi...

Java temp files and automated deletion

It is safe to use java's createTempFile method to create a temp file and then rename it and keep it as a permanent file? Or does java or the system in some way keep track of its temporary files and delete them at some point? btw..this is related to Mac OS X specifically. ...

Copy a changing file with File.Copy

Hi, I'm writing some sort of backup tool that has to copy all the files in a directory. Now I'm using C#'s File.Copy(String, String, Boolean) method. But another application (which I can't change) simultaneously writes to the files in that directory. So now I wonder if it is possible that a file gets changed halfway the copying process...

How do I find which database uses a file

Using MS SQL Server 2005. On one of our servers we're running out of room, so I'm going through the databases, shrinking, removing, backuping etc. The largest file in the Data directory (an .mdf no less, not a .ldf) is not named according to our common naming-convention (it should reflect the database's name). I cannot move the file, s...

linking files as a HTML-file and it's folder

In a windows-environment if you have a .html-file, you can make a copy of it and move it in the file-system. But the folder containing the additional files (images, scripts, .css-files) is moved with it. I want to know how you can implement this with files of other extensions (self defined file-extensions). I suppose it has to do with th...