files

Basic C++ Header File Question

Hi, I have a project with two header files mainwindow.h and website.h. I want to access a method from website.cpp from inside mainwindow.cpp. I can access any function from inside mainwindow by doing Window w then doing w->function(); However, when the function finishes from inside the mainwindow the memory for w is erased. How do...

Playing around with Eclipse features - Project files are now hidden?

I don't even remember how, but somehow I managed to make all of my project's source files hidden in Eclipse's Package and Project Explorer panels. Go figure. 'Show Filtered Children (alt+click)' temporarily reveals the files, and only in Package Explorer can I double-click to reopen them from this view. They go back into hiding after ...

How to create file of files?

class Node { FooType Data; // I can save Data to file with extension .foo void Save() { // save Data to .foo file } } Now , class Graph { List<Node> Nodes; void Save() { foreach(Node node in Nodes) { node.Save(); } } } Now when I invoke someGraph.Save(); the...

Detecting and handling third-party library filehandle leaks in Java

Is there any way to detect and handle whether a Java library is correctly releasing file-handles (via "close") from within a Java program that is using said library, short of having access to the actual library code and inserting the corresponding "finally close" statements? If detection is feasible, is there any way to close those file...

searching within a compressed sorted fixed width file

Assume I have a regular fixed width file that is sorted on one of the fields. Given that I know the length of the records, I can use lseek to implement a binary search to find records with fields that match a given value without having to read the entire file. Now the difficulty is that the file is gzipped. Is it possible to do this wi...

Java File and ByteArray or InputStream - please quick help

I want to use jFuge to play some MIDI music in an applet. There's a class for the MIDI pattern - Pattern - and the only method to load the pattern is from a File. Now, I don't know how applets load files and what not, but I am using a framework (PulpCore) that makes loading assets a simple task. If I need to grab an asset from a ZIP cata...

Determine whether a folder is present?

How would I go about determining whether a file or directory has been created in Java? I basically want to create a data directory if one is not already present. Thanks. ...

$_FILES empty on image upload

i need help, i'm programing some kind of catalogue and i have a page where clients can upload their logo or images. every page i make is included in index.php and my url looks like something like this www.url.com/index.php?s=upload where "upload" is name of upload.php file. when i create form on that upload.php file and submit it, $_FIL...

How can I convert a zfo to a standard xml file?

I have this file format from 602 form filler. Unfortunately 602 sotfware no longer offer an SDK to their product. I've uploaded the file here : http://cid-d53719d869fb8243.skydrive.live.com/self.aspx/Public/31602.zfo I can't figure out how convert the file from zfo to .fo. Honestly I don't even know if the file is zipped or encoded, s...

Dealing with Windows line-endings in Python

I've got a 700MB XML file coming from a Windows provider. As one might expect, the line endings are '\r\n' (or ^M in vi). What is the most efficient way to deal with this situation aside from getting the supplier to send over '\n' :-) Use os.linesep Use rstrip() (requiring opening the file ... which seems crazy) Using Universal newli...

How can I check if contents of one file exist in another in Perl?

Requirement:- File1 has contents like - ABCD00000001,\some\some1\ABCD00000001,Y,,5 (this indicates there are 5 file in total in unit) File2 has contents as ABCD00000001 So what i need to do is check if ABCD00000001 from File2 exist in File1 - if yes{ print the output to Output.txt till it finds another ',Y,,X'} else{ No keep che...

Directory.GetFiles returning entire path, I only want the filename?

This is the code I have set up to scan a directory of files: Dim fileArray() As String fileArray = Directory.GetFiles(System.AppDomain.CurrentDomain.BaseDirectory & "help\") And it successfully gets all files in the directory, but it gets their absolute paths aswell. For example, one of the entries in fileArray() is: F:\Project\Proje...

Check if file exists, including on PATH

Given a filename in C, I want to determine whether this file exists and has execute permission on it. All I've got currently is: if( access( filename, X_OK) != 0 ) { But this wont search the PATH for files and will also match directories (which I don't want). Could anyone please help? Edit: As an alternative, seeing as I'm running e...

Unable to open a file for writing

I am trying to write to a file. I do a file_exists check on it before I do fopen and it returns true (the file does exist). However, the file fails this code and gives me the error every time: $handle = fopen($filename, 'w'); if($handle) { flock($handle, LOCK_EX); fwrite($handle, $contents); } else { echo 'ERROR: Unable to ...

How to check for a dynamically created file in Java?

I have an application where I need to check for a file which may be created dynamically during my execution, I will give up after some MAX time where the file has yet to show up. I wanted to know if there was a more efficient method in Java of checking for the file other than polling for it and then sleeping every X seconds? If not what ...

PHP Help with "if" statement to dynamically include files

Hello, I have these files: "id_1_1.php", "id_1_2.php", "id_1_3.php" etc "id_2_1.php", "id_2_2.php", "id_2_3.php" etc the number of files is not known because will always grow.. all the files are in same directory.. I want to make a if statement: to include the files only if their name ends with "_1" another function to load all th...

Where does the mysql database files actually reside?

Hi, Im just curious as I am beginning to learn php and mysql, as to where the database and other files of mysql reside on the hard drive. I have installed wamp on a windows xp sp2 platform. ...

ideas: per-file authentication in order to download

i would love to use mod_xsendfile but i live in a shared environment which does not provide such a module. processing large files such as videos through a server-side script and sending it to the browser that way seems to be unacceptable in my case, so i am looking for a way to enable per-file authentication in such a way that is not goi...

problem in write file or mkdir on android device

Hi. I have a android application which is write some html files on the sdcard. The application run on emulator very well. But when I tried to run the same application on OMAP android device It can't write files or mkdir on the device sdcard. I don't know how it happened. My OMAP device use sdcard for file system at the boot time tha...

How to organize a large number of objects

We have a large number of documents and metadata (xml files) associated with these documents. What is the best way to organize them? Currently we have created a directory hierarchy: /repository/category/date(when they were loaded into our db)/document_number.pdf and .xml We use the path as a unique identifier for the document in our...