file

Can anyone explain the File() parameters used to download file in android ?

In Reference to this android file download problem http://stackoverflow.com/questions/576513/android-download-binary-file-problems Can anyone explain what does this line mean in the code FileOutputStream f = new FileOutputStream(new File(root,"Video.mp4")); And what does it mean by the parameter root within the File(). Do I need to...

Is there a managed/.NET way to access the summary information for a file?

When you right-click on a file in Windows and select "Properties" from the menu, it opens the Properties window. On that window for most files types there's a "Summary" tab that contains a variety of information. Is there a managed/.NET way to retrieve that information? I had assumed incorrectly that this would be a trivial thing to do ...

Can i download file without using the phone memory instead of virtual SD card in emulator?

In reference to question http://stackoverflow.com/questions/2147704/can-anyone-explain-the-file-parameters-used-to-download-file-in-android Can I do it without creating virtual SD Card. Is there any way to save the file in phone memory in internal memory? if it is possible without using the virtual SD Card, then how? ...

Size of folder or file

How can I retrieve size of folder or file in java ? ...

Class file in visual studio 2008

seWhen i creating a new class file i got these namespaces by default, using System; using System.Data; using System.Configuration; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System....

Google app engine to run executable files

Hi, Is it possible to run executable files in google app engine? Like by using Runtime.exec? There is whitelist on google app engine documentation which list classes that can be used but functions/ inside the classes are not specified. Thanks! ...

Serializing ENUM Singleton

I'm trying to serialize an ENUM singleton instance (as described by Joshua Bloch in his book Effective Java) to a file. The ENUM instance is a simple JavaBean as this: public enum ElvisFan implements Serializable{ INSTANCE; private int totalSongsListened; private ElvisFan(){ totalSongsListened=0; } public void set(int v){ ...

How to detect if executable requires UAC elevation (C# pref)

Hi, how can I detect if executable requires UAC elevation? So far I came to two ideas: picture recognition of executable's icon to check if UAC shield icon is on it and information from wikipedia: http://en.wikipedia.org/wiki/User_Account_Control it is possible to programmatically detect if an executable will require elevation by ...

Java, read from file throws io exception - read error.

Hello all, Im reading from a file (data.bin) using the following approach - fis1 = new FileInputStream(file1); String data; dis1 = new DataInputStream(fis); buffread1=new BufferedReader(new InputStreamReader(dis1)); while( (data= buffread1.readLine())!=null){ } Now im getting the io exception of read error. Now im gue...

How do I refer to a directory in Java?

I'm running Windows and I'm trying to refer to a directory. My function starts off like this: File file = new File("C:\\somedir\\report"); if (!file.exists()) { file.mkdirs(); } doStuffWith(file); I got a NullPointerException within the doStuffWith function, when I tried to call listFiles. Well I looked in C:\somedir and what did I ...

IE6 "helpfully" appends suffix to downloaded file

A webapp I've been developing allows users to upload and download a type of file which is meant to be treated as an opaque blob. My app serves it up with a file extension not commonly used for any other purpose, as well as specifying that its MIME Content-Type is application/octet-stream. Internally, the file is a simple Zip archive co...

Comparing two files

Can anyone create a script for a file comparison? The pseudo code looks like this extract line 5 from file 1 save it in another variable, extract line 5 from file 2, save it in another variable, if variable 1 is not equal to variable 2 (while allowing for differing characters at positions 11 and 12 from the end of line) the...

How do I get specific error information from GetFile()?

void GetFtpFile(LPCTSTR pszServerName, LPCTSTR pszRemoteFile, LPCTSTR pszLocalFile) { CInternetSession session(_T("My FTP Session")); CFtpConnection* pConn = NULL; pConn = session.GetFtpConnection(pszServerName); //get the file if (!pConn->GetFile(pszRemoteFile, pszLocalFile)) { //display an error } delete ...

Accessing the File System for static content?

HI All, In our project we are using a File System to store the static content that is the xmls, xslts, images, gifs etc. and we are following a three tier architecture. The database layer will only contain the metadata while the file system is separate. So, my questions are as follow: 1) Where should we keep the File System Access logi...

Temporary uploaded file location in grails

I'm about to program a file upload in a Grails app - using g:form with *"multipart/form-data"*. Before saving it to disk, I'll check if the file is bigger than a given number of bytes, in which situation it will be discarded. My concern is: is the temporary file stored in some directory before it is moved to the final destination ? Becau...

Efficiently counting the number of lines of a text file. (200mb+)

Hello all, I have just found out that my script gives me a fatal error: Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 440 bytes) in C:\process_txt.php on line 109 That line is this: $lines = count(file($path)) - 1; So I think it is having difficulty loading the file into memeory and counting the ...

Check if a file is setuid root in Python

Hi there, I'm trying to check if a file has the setuid bit in Python. The stat doc mentions a S_ISUID function but it only works with os.chmod(), not to actually read the setuid bit. It also lists S_IMODE, but I have no idea how to interpret it. How can I easily check if a file as the setuid root bit set? ...

Cannot delete file in share using impersonation on ASP.NET site.

We have a web farm and are writing temp files for reports. We set up a file share and are using impersonation to write the temporary report files to that share. We gave the account doing the impersonation full control to the share and the folder itself. The files are writing correctly but are not being deleted. Is there something we're ...

Create a File in C# and pass it as an IntPtr to a COM object

I'm working with some COM objects in C#, one of them has a function called SetLogFile that takes an IntPtr. How can I create the file in C# then pass it as an IntPtr to that COM function? EDIT: The function requires an open file handle: http://msdn.microsoft.com/en-us/library/aa915939.aspx ...

Java: how to get a File from an escaped URL?

I'm receiving an URL that locates a local file (the fact that I receive an URL is not in my control). The URL is escaped validly as defined in RFC2396. How can I transform this to a Java File object? Funnily enough, the URL getFile() method returns a String, not a File. I've created a directory called "/tmp/some dir" (with a spacing ...