files

Why does my application allow me to save files to the Windows and System32 folders in Vista?

I have an application written in Delphi 7 which does not require an admin privilages to run. For some reason I am able to save files to c:\windows and c:\windows\system32 from within the application even though the application has not requested UAC elevation. I am logged in as an admin with UAC turned on and I haven't changed any of t...

Checking if the file is already in use before opening (network drive, C#)

Does there exist any way in .Net to check before opening if a file (on a local network drive) is already in use? ...

(Physical)(Installed) path of DLL installed to the GAC.

How can I get the (physical) installed path of a DLL that is (may be) registered in GAC? This DLL is a control that may be hosted in things other than a .Net app (including IDEs other than VS...). When I use System.Reflection.Assembly.GetExecutingAssembly().Location, it gives path of GAC folder in winnt\system32 - or in Design mode in V...

software that store data in flat file, what are common encoding/file format techniques

Hi, I have been spoiled by either using sql server to store data, or using xml files. What are common techniques for storing data in flat files other than xml and CSV. I know many times when I open files that data is all jumbled up, which means it is encoded right? Are there any common techniques that I could read about somewhere? ...

Viewing more than 10,000 files on a FTP file server?

I've queued up over 10,000 files to be uploaded to a UNIX based FTP server using a freeware (Windows based) FTP client which as far as i can see has finished without error. Now, when i view the remote directory (using the Windows software) the output is truncated to 10,000 filenames. This ever occurs when i use the Windows command line ...

How to encrypt a value in ini file

What is the best way to encrypt a value in INI file? Using Encryption/Decryption key?? ...

Copying millions of files

I've got about 3 million files I need to copy from one folder to another over my company's SAN. What's the best way for me to do this? ...

What's the best way to do a cross-platform, atomic file replacement in Perl?

I have a very common situation. I have a file, and I need to entirely overwrite that file with new contents. However, the original file is accessed on every page load (this is a web app), so it can't be missing for very long. A few ms is OK (though not ideal), a second is not OK. Right now I do this by writing a temp file to the same di...

Monitor a set of files for changes and execute a command on them when they do.

The (command line) interface I have in mind is like so: watching FILE+ do COMMAND [ARGS] (and COMMAND [ARGS])* Where any occurrence of "{}" in COMMAND is replaced with the name of the file that changed. And note that "do" and "and" are keywords. For example: > watching foo.txt bar.txt do scp {} somewhere.com:. and echo moved {} to ...

What is a good scripting language for basic file operations?

I often need to copy, move or rename files and directories based on some criteria as I collect data from many resources and I like to keep things organized. What scripting language provides the most intuitive and easy to use methods for these operations? Here is an example scenario: I keep my music in a folder hierarchy like below: &Ar...

Max files per directory in S3

Hi, If I had a million images, would it be better to store them in some folder/sub-folder hierarchy or just dump them all straight into a bucket (without any folders)? Would dumping all the images into a hierarchy-less bucket slow down LIST operations? Is there a significant overhead in creating folders and sub folders on the fly and ...

Text specification for a tree of files?

I'm looking for examples of specifying files in a tree structure, for example, for specifying the set of files to search in a grep tool. I'd like to be able to include and exclude files and directories by name matches. I'm sure there are examples out there, but I'm having a hard time finding them. Here's an example of a possible synt...

Inno setup: hide files

How can I hide the files while installing my application using an Inno Setup made package? It can be hidden by "[files] attribs : hidden" but it again can be seen by activating the windows option "Show hidden file" How can I hide it permanently to avoid user tempering with EXE file? ...

How do you manage and organize your files? (scripts, repos, downloads, pdf's, etc)

Like many of you, I have to deal with a large amount of files: source code, binary downloads, spreadsheets, pdf's, word docs, images, note files, quick scripts, and more. These files can fall into many categories: Temporary files that should eventually be deleted Important or useful references files that should be archived Files tied ...

How does gedit edit and save a large file before the file is finished loading?

I wanted to edit just the first line of a 4 MB file. When I open files this large in gedit, it takes a minute or two to load the file but displays and allows you to edit the part that it has loaded so far. So I opened the file, quickly edited the first line, saved the file, and closed gedit all before it was even close to finishing loadi...

How can I process a list of files that includes spaces in its names in Unix?

I'm trying to list the files in a directory and do something to them in the Mac OS X prompt. It should go like this: for f in $(ls -1); do echo $f; done If I have files without spaces in their names (fileA.txt, fileB.txt), the echo works fine. If the files include spaces in their names ("file A.txt", "file B.txt"), I get 4 strings (fil...

WPF/C#: Where should I be saving user preferences files?

Whats the recommended location, to save user preference files? Is there a recommmended method(or should I call it pattern) of dealing with user preferences? Currently I use the path returned from typeof(MyLibrary).Assembly.Location as a default location to store files generated or required by the app. EDIT: Found two related/interestin...

How does Django serve media files?

I have set up a Django application that uses images. I think I have set up the media settings MEDIA_ROOT and MEDIA_URL correctly. However the images don't show up. Do you know what can be the problem? Let consider this example: The image files are under /home/www/media/app/photos and we are trying to request http://example.com/photos/1...

How to determine file type in bash script?

I am writing a nightly build script in bash. Everything is fine and dandy except for one little snag: #!/bin/bash for file in "$PATH_TO_SOMEWHERE"; do if [ -d $file ] then # do something directory-ish else if [ "$file" == "*.txt" ] # this is the snag then ...

String value that represents an email attachment, how to store to disk/db?

Ok it turns out this 3rd party component I am working with stores an email attachment in a property of string type (it is already decoded). How would I store this to file now? It has: filename, encodingtype and the string representation of the file. ...