Search Results

Search found 46908 results on 1877 pages for 'managing files and folder'.

Page 33/1877 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • Python (windows) will open files from command line, but not from a script launched from eclipse

    - by Blake
    I'm pretty new to writing python for windows (linux is no problem), and am having problems getting python to recognize files when running scripts, though it behaves fine in the command line What am I doing wrong here? def verifyFile(x): # return os.path.isfile(x) This will return true (with a valid file, of course) when called from the python command line, but when I run the script from eclipse, or launch it from windows, it ALWAYS returns false. Any thoughts on why this is? I've tried passing pathnames like this: D:\Documents and Settings\BDE\Desktop\cdburn.jpg and like this: D:/Documents and Settings/BDE/Desktop/cdburn.jpg I've changed sys,argv[0] to '' I've tried this: def verifyFile(x): # try: f = open(x, 'r') f.close() return True except: return False and am getting no love! Any help would be appreciated. Thanks Blake

    Read the article

  • store/load numpy array from binary files

    - by Javier
    Dear all, I would like to store and load numpy arrays from binary files. For that purposes, I created two small functions. Each binary file should contain the dimensionality of the given matrix. def saveArrayToFile(data, fileName): with open(fileName, 'w') as file: a = array.array('f') nSamples, ndim = data.shape a.extend([nSamples, ndim]) # write number of elements and dimensions a.fromstring(data.tostring()) a.tofile(file) def readArrayFromFile(fileName): _featDesc = np.fromfile(fileName, 'f') _ndesc = int(_featDesc[0]) _ndim = int(_featDesc[1]) _featDesc = _featDesc[2:] _featDesc = _featDesc.reshape([_ndesc, _ndim]) return _featDesc, _ndesc, _ndim An example on how to use the functions is: myarr=np.array([[7, 4],[3, 9],[1, 3]]) saveArrayToFile(myarr,'myfile.txt') _featDesc, _ndesc, _ndim = readArrayFromFile('myfile.txt') However, an error message of 'ValueError: total size of new array must be unchanged' is shown. My arrays can be of size MxN and MxM. Any suggestions are more than welcomed. I think the problem might be in the saveArrayToFile function. Best wishes, Javier

    Read the article

  • Fast search in XMl files in .NET (or How to index XML files)

    - by codymanix
    I have to implement a search feature which is able to quickly perform arbitrary complex queries to XML-data. If the user makes a query, all XML files must be searched to find possible matches. The users will have lots of XML-Files (a few 10000 or more) which are typically a few kilobytes in size. All the XML-files have almost the same structure. I already benchmarked XPath, it is too slow for my needs. How can it be done most efficiently? Is is possible to create indexes for the contents of the XML files (preserving content semantics, not just plain fulltext search)? Will it be useful to put the XML data into an (embedded) SQL database and do the queries with SQL? What other possibilities do I have?

    Read the article

  • Using Mapped Memory Files in C# to store reference types

    - by Khash
    I need to store a dictionary to a file as fast as possible. Both key and value are objects and not guaranteed to be marked as Serializable. Also I prefer a method faster than serializing thousands of objects. So I looked into Mapped Memory Files support in .NET 4. However, it seems MemoryMappedViewAccessor only allows storage of structs and not reference types. Is there a way of storing the memory used by a reference type of a file and reconstructing the object from that blob of memory (without binary serialization)?

    Read the article

  • iPhone first time application ran and config files

    - by VansFannel
    Hello. I have two question: I'm developing an iPhone application and I want to know when it is the first time the application is executed. I want to check some extended permissions from facebook the first time. How can I know that? (first question) Another way to solved this problem is to store the extended permissions granted in some configuration file. I don't want to make visible this file through app settings icon. How can I add some configuration files to store these permissions granted? (second question) Thanks

    Read the article

  • Memory-Mapped Files & Transparent Persistence of Java Objects

    - by geeko
    Greeting All, I want to achieve transparent persistence of Java objects through memory-mapped files (utilize the OS paging/swapping mechanism). My problem is: how can I move a Java object to my memory-mapped block ? Plus, how can I force a new object instance to reside in such blocks ? As you all know, a memory-mapped block can be seen as a byte array, and what I am really asking here is how to overlap the address space of Java objects with the one of such arrays ? If Java does not allow me for this, what cross-platform & garbage-collecting OO language would you advise me to use ? Thank you all in advance.

    Read the article

  • File Handler returning garbled files.

    - by forcripesake
    For the past 3 months my site has been using a PHP file handler in combination with htaccess. Users accessing the uploads folder of the site would be redirected to the handler as such: RewriteRule ^(.+)\.*$ downloader.php?f=%{REQUEST_FILENAME} [L] The purpose of the file handler is pseudo coded below, followed by actual code. //Check if file exists and user is downloading from uploads directory; True. //Check against a file type white list and set the mime type(); $ctype = mime type; header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // required for certain browsers header("Content-Type: $ctype"); header("Content-Disposition: attachment; filename=\"".basename($filename)."\";" ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($filename)); readfile("$filename"); As of yesterday, the handler started returning garbled files, unreadable images, and had to be bypassed. I'm wondering what settings could have gone awry to cause this.

    Read the article

  • How to version control config files pragmatically?

    - by erenon
    Suppose we have a config file with sensitive passwords. I'd like to version control the whole project, including the config file as well, but I don't want to share my passwords. That could be good, if this config file: password=secret foo=bar becomes password=* foo=bar and the other users of the vcs could also set up the password on they own. To ignoring the file isn't a good approach, the developers should be aware, if the config file changes. Example: Local version: password=own_secret foo=bar config file in vcs: password=* foo=bar Then suddenly, the config file changes: password=* foo=bar baz=foo And the local version would become for each developer: password=own_secret foo=bar baz=foo This is my solution. How could I achieve this behaviour? How do you store your config files? Is there a way to do that, or should I hack something?

    Read the article

  • Programming a loopback-device consisting of several files in Linux

    - by dubbaluga
    Hej, it is relatively easy to use a file for emulating a block-device using losetup in Linux: http://www.walkernews.net/2007/07/01/create-linux-loopback-file-system-on-disk-file/ Can anyone please give me a hint on what to look for in case I want to program my own block-device which is based on several files I'm taking content from? For your understanding, I would like to let's say take bytes 1-500 and 1.000-3.000 from file1 and bytes 501-999 and bytes 3.001 to 5.000 from file2 to offer them as a combined block-device. My prefered programming language is Python and I want to write my program in user-space as much as possible. For Windows I found such an implementation. It's called FileDisk and HttpDisk and it can be found here: http://www.acc.umu.se/~bosse/ Thanks in advance and regards, Rainer

    Read the article

  • Merge changes when a file on a branch has split into two files on the master

    - by carleeto
    This is basically the result of a massive class C on the master having been refactored down the line into two smaller classes, C1 and C2. C was then made a subclass of C2 and cut down to a skeletal version for backward compatibility. So from that point on, master contained C, C1 and C2. On that master commit git said C was renamed to C1. The branch was last updated before this happened. (All C++ code, if it helps to visualize the files involved) Obviously, when I tried a rebase of the branch onto master, there were conflicts that needed to be resolved. As usual, I used mergetool. So now the mergetool comes up with the following: On Local, I have the skeletal version of C. Base and Remote have a bunch of changes to C. Because the skeletal version of C exists on Local, I conclude that the changes from Base and Remote should actually go into C1, leaving C alone. My question is, how do I do this?

    Read the article

  • How to make g++ search for header files in a specific directory?

    - by Bane
    I have a project that is subdivided into a few directories with code in them. I'd like to to have g++ search for header files in the project's root directory, so I can avoid different include paths for same header files across multiple source files. Mainly, the root/ directory has sub-directories A/, B/ and C/, all of which have .hpp and .cpp files inside. If some source file in A wanted to include file.hpp, which was in B, it would have to do it like this: #include "../B/file.hpp". Same for another source file that was in C. But, if A itself had sub-directories with files that needed file.hpp, then, it would be inconsistent and would cause errors if I decided to move files (because the include path would be "../../B/file.hpp"). Also, this would need to work from other projects as well, which reside outside of root/. I already know that there is an option to manually copy all my header files into a default-search directory, but I'd like to do this the way I described.

    Read the article

  • Windows XP Disappearing Folders

    - by XenoFoxx
    I am researching a problem for a friend, and unfortunatly do not have direct access to his computer. I've tried to gather as much information as possible and I have researched it on various websites. I've not found anyone having the same problem my friend is having. So here goes: He has a media server in his home running Microsoft Windows XP. It has 3 drives, 1 for the OS and 2 for mass storage. Not long ago he went to access one of the mass storage media drives and it was empty, except for a single folder. His first assumption was that his roommate had deleted everything on the drive (excluding the remaining folder). He then checked the properties of the drive and it was still saying that the hard drive was nearly full. I told him to check the recycling bin, thinking that whoever deleted them didn't clear them from recycling and that they were still taking up space on the drive. My friend said the recycling bin was empty. So we have a drive that the windows file management system says is empty (again except for the remaining folder), but the properties of the drive say it's mostly full. Now it gets weirder My friend tried to create a new folder on this drive and it auto-named itself "New Folder(1)" which means that it recognizes there is already a "New Folder" in that directory. He tried to rename it to a name that he KNEW was there previsouly, and windows wouldn't allow it because it was a duplicate folder name. SO now it seems the folders are there, but not displaying in Windows Explorer. Both of us have no idea why this is occuring, why the folders vanished, why the one remaining folder didn't vanish, or how to make them visable again. Anyone else ever experience this? I can get more details if needed.

    Read the article

  • How to convert Xml files to Text Files

    - by John
    Hi all, I have around 8000 xml files that needs to be converted into text files. The text file must contain title, description and keywords of the xml file without the tags and removing other elements and attributes as well. In other words, i need to create 8000 text files containing the title,description and keywords of the xml file. I need codings for this to be done systematically. Any help would be greatly appreciated. Thanks in advance.

    Read the article

  • Safe way to support hosting files from asp.net mvc site

    - by ooo
    i have an asp.net-mvc site where users can add content and links and the data gets saved in a database. They now want the ability to upload attachments to pages and i wanted to figure out a few things: I have upload code that will upload files (pdfs, images, etc) but i wanted to see where i should be storing them. should i store them outside the website directory structure ? Is there any file types that i should be concerned with storing. I would basically have a file picker on the front end.

    Read the article

  • WIndows 7: would like recursively check a directory for changes to files and folders since my last visit

    - by user1026169
    I have found varieties of this question. Most of them fall under monitoring and others are said to be buggy. A continuously monitoring program won't help me and neither will a list of the most recently modified files. I would like to check if the directory, its sub folders and files have changed since my last visit. It seems to me that I'd likely need a program that maintains and index of that directory and compares it with its condition when I tell it to. Then that program could output to a log for my use. This is on Windows 7 over a shared network, the folder(s) I'd like to check have 4-50GB of data. I did find this, however I am still learning how to program. I think it describes what I want: http://www.rgagnon.com/javadetails/java-0490.html Thanks for considering.

    Read the article

  • Load big XML files to mySQL database (PHP)

    - by Kees
    Hello There, For a new project I need to load big XML files (200MB+) to a mySQL database. There are +- 20 feeds i need to match with that (not all fields are the same). Now when i want to catch the XML I get this error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 171296569 bytes) in E:\UsbWebserver\Root\****\application\libraries\MY_xml.php on line 21 Is there an easy solution for this? It's not possible to get te feed in parts of a few MB's each. Thank you very much! P.s. has somebody an idea to match xml-feeds easy?

    Read the article

  • How to Open Any Folder as a Project in the NetBeans Platform

    - by Geertjan
    Typically, as described in the NetBeans Project Type Tutorial, you'll define a project type based on the presence of a file (e.g., "project.xml" or "customer.txt" or something like that) in a folder. I.e., if the file is there, then its parent, i.e., the folder that contains the file, is a project and should be opened in your application. However, in some scenarios (as with the HTML5 project type introduced in NetBeans IDE 7.3), the user should be able to open absolutely any folder at all into the application. How to create a project type that is that liberal? Here you go, the only condition that needs to be true is that the selected item in the "Open Project" dialog is a folder, as defined in the "isProject" method below. Nothing else. That's it. If you select a folder, it will be opened in your application, displaying absolutely everything as-is (since below there's no ProjectLogicalView defined): import java.beans.PropertyChangeListener; import java.io.IOException; import javax.swing.Icon; import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectInformation; import org.netbeans.spi.project.ProjectFactory; import org.netbeans.spi.project.ProjectState; import org.openide.filesystems.FileObject; import org.openide.loaders.DataFolder; import org.openide.loaders.DataObjectNotFoundException; import org.openide.nodes.FilterNode; import org.openide.util.Exceptions; import org.openide.util.ImageUtilities; import org.openide.util.Lookup; import org.openide.util.lookup.Lookups; import org.openide.util.lookup.ServiceProvider; @ServiceProvider(service = ProjectFactory.class) public class FolderProjectFactory implements ProjectFactory { @Override public boolean isProject(FileObject projectDirectory) { return DataFolder.findFolder(projectDirectory) != null; } @Override public Project loadProject(FileObject dir, ProjectState state) throws IOException { return isProject(dir) ? new FolderProject(dir) : null; } @Override public void saveProject(Project prjct) throws IOException, ClassCastException { // leave unimplemented for the moment } private class FolderProject implements Project { private final FileObject projectDir; private Lookup lkp; private FolderProject(FileObject dir) { this.projectDir = dir; } @Override public FileObject getProjectDirectory() { return projectDir; } @Override public Lookup getLookup() { if (lkp == null) { lkp = Lookups.fixed(new Object[]{ new Info(), }); } return lkp; } private final class Info implements ProjectInformation { @Override public Icon getIcon() { Icon icon = null; try { icon = ImageUtilities.image2Icon( new FilterNode(DataFolder.find( getProjectDirectory()).getNodeDelegate()).getIcon(1)); } catch (DataObjectNotFoundException ex) { Exceptions.printStackTrace(ex); } return icon; } @Override public String getName() { return getProjectDirectory().getName(); } @Override public String getDisplayName() { return getName(); } @Override public void addPropertyChangeListener(PropertyChangeListener pcl) { //do nothing, won't change } @Override public void removePropertyChangeListener(PropertyChangeListener pcl) { //do nothing, won't change } @Override public Project getProject() { return FolderProject.this; } } } } Even the ProjectInformation implementation really isn't needed at all, since it provides nothing more than the icon in the "Open Project" dialog, the rest (i.e., the display name in the "Open Project" dialog) is provided by default regardless of whether you have a ProjectInformation implementation or not.

    Read the article

  • VMware sharing folders between Win7 (host) and Ubuntu (guest)

    - by Pawel Goscicki
    What is the best way to share a folder between Win7 64bit (host) and Ubuntu 10.10 (guest) in VMware player? I can setup the sharing just fine (using vmware-tools), but all shared files are root:root owned with 777 permission set. Which, well, sucks. What can I do to have shared files with preserved ownership and permissions? I'm guessing I would need some kind of a file container, that would get mounted in Ubuntu as a block device (if so, it would need to be dynamic, i.e. expand with size of contained files). But maybe there is a better solution?

    Read the article

  • robocopy transfer file and not folder

    - by Bill McKay
    I'm trying to use robocopy to tranfer a single file from one location to another but robocopy seems to think I'm always specifying a folder. Here is an example: robocopy "c:\transfer_this.txt" "z:\transferred.txt" But I get this error instead: 2009/08/11 15:21:57 ERROR 123 (0x0000007B) Accessing Source Directory c:\transfer_this.txt\ (note the '\' at the end of transfer_this.txt) But if I treat it like an entire folder: robocopy "c:\folder" "z:\folder" It works but then I have to transfer everything in the folder. How can I only transfer a single file with robocopy?

    Read the article

  • Can I move the Flash temp folder/buffer (Win64)

    - by xciter
    I need to move the folder in which the Flash plugin saves its temporary files (so NOT the browser cache folder). Normally, the plugin saves its buffered content in the default temporary folder of the operating system. However, I do not want to move that folder. In other words, I only need to change the folder which flash uses. My operating system is Windows 7 64-bit. I am using the latest version of the flash plugin.

    Read the article

  • Batch copy multiple folders and their subfolders to another folder

    - by DjLenny
    I have a folder X:\Export that has several folders X:\Export\Export1 X:\Export\Export2 X:\Export\Export3 etc. (names vary by a large factor) each Export folder has the same subdirectory structure but have different files. I would like to copy all the subfolders and the files of X:\Export\Export1 X:\Export\Export2 X:\Export\Export3 to a folder X:\Export\mergedExports keeping the subdirectory structure pseudocode of what I would like to do but cannot get working properly create new folder "merged" for (every folder X in a given directory Y) copy every file in X keeping directory structure to "merged" If conflict then overwrite

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >