Search Results

Search found 37883 results on 1516 pages for 'sparse files'.

Page 126/1516 | < Previous Page | 122 123 124 125 126 127 128 129 130 131 132 133  | Next Page >

  • Good way to find duplicate files?

    - by OverTheRainbow
    Hello I don't know enough about VB.Net (2008, Express Edition) yet, so I wanted to ask if there were a better way to find files with different names but the same contents, ie. duplicates. In the following code, I use GetFiles() to retrieve all the files in a given directory, and for each file, use MD5 to hash its contents, check if this value already lives in a dictionary: If yes, it's a duplicate and I'll delete it; If not, I add this filename/hashvalue into the dictionary for later: 'Get all files from directory Dim currfile As String For Each currfile In Directory.GetFiles("C:\MyFiles\", "File.*") 'Check if hashing already found as value, ie. duplicate If StoreItem.ContainsValue(ReadFileMD5(currfile)) Then 'Delete duplicate 'This hashing not yet found in dictionary -> add it Else StoreItem.Add(currfile, ReadFileMD5(currfile)) End If Next Is this a good way to solve the issue of finding duplicates, or is there a better way I should know about? Thank you.

    Read the article

  • Absolute path of a file object

    - by Morgoth
    This has been discussed on StackOverflow before - I am trying to find a good way to find the absolute path of a file object, but I need it to be robust to os.chdir(), so cannot use f = file('test') os.path.abspath(f.name) Instead, I was wondering whether the following is a good solution - basically extending the file class so that on opening, the absolute path of the file is saved: class File(file): def __init__(self, filename, *args, **kwargs): self.abspath = os.path.abspath(filename) file.__init__(self, filename, *args, **kwargs) Then one can do f = File('test','rb') os.chdir('some_directory') f.abspath # absolute path can be accessed like this Are there any risks with doing this?

    Read the article

  • C++ Beginner - Trouble using classes inside of classes

    - by Francisco P.
    Hello, I am working on a college project, where I have to implement a simple Scrabble game. I have a player class (containing a Score and the player's hand, in the form of a std::string, and a score class (containing a name and numeric (int) score). One of Player's member-functions is Score getScore(), which returns a Score object for that player. However, I get the following error on compile time: player.h(27) : error C2146: syntax error : missing ';' before identifier 'getScore' player.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int player.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int player.h(27) : warning C4183: 'getScore': missing return type; assumed to be a member function returning 'int' player.h(35) : error C2146: syntax error : missing ';' before identifier '_score' player.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int player.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Here's lines 27 and 35, respectively: Score getScore(); //defined as public (...) Score _score; //defined as private I get that the compiler is having trouble recognizing Score as a valid type... But why? I have correctly included Score.h at the beginning of player.h: #include "Score.h" #include "Deck.h" #include <string> I have a default constructor for Score defined in Score.h: Score(); //score.h //score.cpp Score::Score() { _name = ""; _points = 0; } Any input would be appreciated! Thanks for your time, Francisco EDIT: As requested, score.h and player.h: http://pastebin.com/3JzXP36i http://pastebin.com/y7sGVZ4A

    Read the article

  • check params['Filedata'] in rails.

    - by krunal shah
    How to check that my params['Filedata'] is corrupted or not? I have function it's reading file from params['Filedata'] and writing it to the other file. File.open(upload_file, "wb") { |f| f.write(params['Filedata'].read) } this line working fine for me.. But when i am calling this function with delayed job funtion send_later than I am getting error with params['Filedata'].read.

    Read the article

  • Enumerating File Handles in C#

    - by user293392
    I would like to know whether it is possible to enumerate file handles in c#, maybe using Win32API. This is easily done for window and process handles, but it seems that it is not possible for file handles. While some functionality is offered by NtQuerySystemInformation, this is being phased out and therefore it is not recommended to use such a method.

    Read the article

  • How can I find which process has opened a specific file?

    - by Hosam Aly
    How can I find which processes have a specific file opened, and their open, access and share modes? Additionally, is it possible to change these values for a process? Or is it even possible to open a file for reading if it is already opened for exclusive access by another process? Please note that I don't want to invalidate the handle of the process having the file opened. I just want to be able to access the file (if possible). (I'm mainly asking about Windows, but solutions for other platforms are welcome, since they contribute to the community's knowledge.) Edit: I found some answers for my first question here and there. Edit 2: Thanks everybody for the tools you mentioned, but I am mainly looking for programmatical techniques (e.g. using Win32 APIs).

    Read the article

  • Creating an installer with WPF forms, packaged files and custom setup actions

    - by RodH257
    I'm trying to create a way of deploying a set of tools (which are add-ins to 3rd party software) to my users. I would like to do the following: User Enters Serial Dlls in their directory structure is extracted to program files a file is copied to a location in ProgramData (this registers my add-ins to the 3rd party application) Online activation for software is performed Can anyone point me into the right direction for this? I had a look at deployment projects in Visual Studio but I'm not sure if they are what I'm after. Main problem is they are ugly, I would like to have a nice WPF installer, and have a more custom experience. But I guess that can be traded off if its going to make things easier. I was thinking, I could just make my own C# project that extracts the files, but I have no idea how to package them up and extract them all as part of one download (like the MSI files that the deployment projects create). Can anyone point me in the right direction?

    Read the article

  • Kohana3: Absolute path to a file

    - by Svish
    Say I have a file in my kohana 3 website called assets/somefile.jpg. I can get the url to that file by doing echo Url::site('assets/somefile.jpg'); // /kohana/assets/somefile.jpg Is there a way I can get the absolute path to that file? Like if I want to fopen it or get the size of the file or something like that. In other words, I would like to get something like /var/www/kohana/assets/somefile.jpg or W:\www\kohana\assets\somefile.jpg or whatever is the absolute path.

    Read the article

  • not readable PDF files

    - by Michal_R
    Hello, I am writing Master's thesis - NLP system. I have one component - extractor. It is extracting a plain text from PDF files. There are a few PDF files that can not be extracted correctly. Extractor (PDFBox library) returns a string like this: "¦xDn¦if|d+gDF"Ti&cD+lh d FÁhis~n +xd f«"d¦ffih »h" or "10a61a91a22a25a3a27a17a23a20a8a13a14a61a25a17" I was checking each file that makes this extraction's problem and all these files' text also can not be copy-pasted from PDF Reader (Adobe Reader and FoxIt reader). Viewing them in this readers is enabled, but after selecting its content and copying to the clipboard I get the same wrong text (as described above - strings of not semanticaly correct chars or strings of digits and letters) Could anybody help me??? THX :)

    Read the article

  • ActionScript 3 class over several files - how?

    - by Poni
    So, how do we write a class over several files in action script 3? In C# there's the "partial" keyword. In C++ it's natural (you just "#include ..." all files). In Flex 3, in a component, you add this tag: <mx:Script source="myfile.as"/>. How do I split the following class into several files; package package_path { public class cSplitMeClass { public function cSplitMeClass() { } public function doX():void { // .... } public function doY():void { // .... } } } For example I want to have the doX() and doY() functions implemented in another ".as" file. Can I do this? And please, don't tell me something like "a good practice is to have them in one file" :)

    Read the article

  • Download Drools RuleFlow files from Guvnor

    - by Shakil Siraj
    Hello all, I can upload RuleFlow (.rf) files to Guvnor (both 5.1 M1 and 5.0) and execute them with rules on the server. If I want to use Guvnor as a repository, is there any way I can download the RuleFlow files into my project on the fly? On the package level, Guvnor provides some "Information and Important URLs" which only talk about rules. I was wondering if there is any other URL which will give me the RuleFlow files? Is WebDav my only other option? Thanks in adavance.

    Read the article

  • Carrier Wave not completing upload to Rackspace Cloud Files

    - by Zack Fernandes
    Hello, I have been attempting to get file uploads to Rackspace Cloud Files online all night, and finally tried the Carrierwave Plugin. Although the plugin worked right away, when I tried viewing the file uploaded (an image) it was broken. Upon further testing, I found out that files would upload to Cloud Files, however were just a fraction of their original size. I can't seem to figure out what's worng, and any help would be greatly appreciated. My code is as follows. models\attachment.rb class Attachment < ActiveRecord::Base attr_accessible :title, :user_id, :file, :remote_file_url, :file_cache, :remove_file belongs_to :user mount_uploader :file, AttachmentUploader end uploaders\attachment_uploader.rb class AttachmentUploader < CarrierWave::Uploader::Base storage :cloud_files def store_dir "#{model.user_id}-#{model.id}" end end

    Read the article

  • Srping, autowire @Value from a database

    - by Guido
    I am using a properties File to store some configuration properties, that are accessed this way: @Value("#{configuration.path_file}") private String pathFile; Is it possible (with Spring 3) to use the same @Value annotation, but loading the properties from a database instead of a file ?

    Read the article

  • Mercurial/.hgignore - How do I ignore everything but the contents of a folder?

    - by Beibin
    I have a NetBeans project and the Mercurial repository is in the project root. I would like it to ignore everything except the contents of the "src" and "test" folders, and .hgignore itself. I'm not familiar with regular expressions and can't come up with one that will do that. The ones I tried: (?!src/.*) (?!test/.*) (?!^.hgignore) (?!src/.|test/.|.hgignore) These seem to ignore everything, I can't figure out why. Any advice would be great.

    Read the article

  • Temp file that exists only in RAM?

    - by Auraomega
    I'm trying to write an encrpytion using the OTP method. In keeping with the security theories I need the plain text documents to be stored only in memory and never ever written to a physical drive. The tmpnam command appears to be what I need, but from what I can see it saves the file on the disk and not the RAM. Using C++ is there any (platform independent) method that allows a file to exist only in RAM? I would like to avoid using a RAM disk method if possible. Thanks Edit: Thanks, its more just a learning thing for me, I'm new to encryption and just working through different methods, I don't actually plan on using many of them (esspecially OTP due to doubling the original file size because of the "pad"). If I'm totally honest, I'm a Linux user so ditching Windows wouldn't be too bad, I'm looking into using RAM disks for now as FUSE seems a bit overkill for a "learning" thing.

    Read the article

  • how to download a file from remote server usingh asp.net

    - by ush
    The below code works fine for downloading a file from a current pc.plz suggest me how to download it from remote server using ip address or any method protected void Button1_Click(object sender, EventArgs e) { const string fName = @"C:\ITFSPDFbills\February\AA.pdf"; FileInfo fi = new FileInfo(fName); long sz = fi.Length; Response.ClearContent(); Response.ContentType = MimeType(Path.GetExtension(fName)); Response.AddHeader("Content-Disposition", string.Format("attachment; filename = {0}", System.IO.Path.GetFileName(fName))); Response.AddHeader("Content-Length", sz.ToString("F0")); Response.TransmitFile(fName); Response.End(); } public static string MimeType(string Extension) { string mime = "application/octetstream"; if (string.IsNullOrEmpty(Extension)) return mime; string ext = Extension.ToLower(); Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext); if (rk != null && rk.GetValue("Content Type") != null) mime = rk.GetValue("Content Type").ToString(); return mime; }

    Read the article

  • How do I start WebDevServer from a .sln file without opening Visual Studio 2008

    - by -providerscriptmaster
    Is there a way to start WebDevServer (Visual Web Development Server) by passing in the .sln file without actually opening Visual Studio 2008? I am a JavaScript developer and I work in a client project and I want to save the memory overhead consumed by VS and give it to multiple browsers for cross-browser testing. I am hesitant with setting up IIS (Visual Web Dev server is SO LIGHT-WEIGHT being Cassini). Please advice. Thanks!

    Read the article

  • PHP is unable to open a file for writing - but it does exist

    - by asdasdas
    I am trying to write to a file. I do a file_exists check on it before i do fopen and it comes up 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 open the file for writing.',PHP_EOL; exit(); } flock($handle, LOCK_UN); fclose($handle); Is there a way I can get more specific error details as to why this file does not let me open it for writing? I know that the filename is legit, but for some reason it just wont let me write to it. I do have write permissions, I was able to write and write over another file.

    Read the article

  • Python: Decent config file format

    - by miracle2k
    I'd like to use a configuration file format which supports key value pairs and nestable, repeatable structures, and which is as light on syntax as possible. I'm imagining something along the lines of: cachedir = /var/cache mail_to = [email protected] job { name = my-media frequency = 1 day source { from = /home/michael/Images source { } source { } } job { } I'd be happy with something using significant-whitespace as well. JSON requires too many explicit syntax rules (quoting, commas, etc.). YAML is actually pretty good, but would require the jobs to be defined as a YAML list, which I find slightly awkward to use.

    Read the article

  • Exception while opening file

    - by viswanathan
    Hi I have a VC++ application and in my application i have some basic file operations. Below is the defaulting code CStdioFile cFile; CFileException e; CString sReport; CString sHtmlfile = "testreport.html" OutputDebugString((sHtmlfile)); if (!cFile.Open(sHtmlfile,CFile::modeCreate | CFile::modeWrite, &e )) { } The problem is my application executes this piece of code every few minutes. and it works fine. After several runs of the code the cFile.Open() function fails. I tried to get the error message TCHAR szError[1024]; e.GetErrorMessage(szError,1024); OutputDebugString((szError)); The irony is the szError error message is "No error occured". This again works once i restart my application. Any idea why this occurs. Thanks in advance.

    Read the article

  • Visual Studio Proj File Help

    - by Alex Baranosky
    I would like to reconfigure the StyleCop import path in my project file. Currently it looks like this: <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets" /> I would like to include the Microsoft.StyleCop.targets file in my project directory, and thus do something like this: <Import Project="$(ProjectDir)\Microsoft.StyleCop.targets" /> Is something like this possible, if so what is the proper way to do it?

    Read the article

  • Renaming and Moving Files in Bash or Perl

    - by Katie
    HI, I'm completely new to Bash and StackOverflow. I need to move a set of files (all contained in the same folder) to a target folder where files with the same name could already exist. In case a specific file exists, I need to rename the file before moving it, by appending for example an incremental integer to the file name. The extensions should be preserved (in other words, that appended incremental integer should go before the extension). The file names could contain dots in the middle. Originally, I was thinking about comparing the two folders to have a list of the existing files (I did this with "comm"), but then I got a bit stuck. I think I'm just trying to do things in the most complicated possible way. Any hint to do this in the "bash way"? It's OK if it is done in a script other than bash script.

    Read the article

< Previous Page | 122 123 124 125 126 127 128 129 130 131 132 133  | Next Page >