filesystem

Can't find the path!

Hi, I'm currently developing an collage application for iPhone and I've now at the point of saving the image and I therefore need the correct path so that the images shows in your image library. Does anyone know the address to the path? BR, drisse ...

::CreateFile with the FILE_FLAG_DELETE_ON_CLOSE flag.

Before I describe my problem, here is a description of the program (IHExplorer.exe) I'm writting: This is a C++ application. The IHExplorer application is to look as much like a Windows Explorer window as possible. With one exception, and that is that launching files from within this Explorer window will decrypt them first to the user'...

Is ASCII "../" the only byte sequence that indicates a directory traversal in PHP?

I have a PHP app that uses a $_GET parameter to select JS/CSS files on the filesystem. If I deny all requests in which the input string contains ./, \ or a byte outside the visible 7-bit ASCII range, is this sufficient to prevent parent directory traversals when the path is passed to PHP's underlying (C-based) file functions? I'm aware...

Can I create an inheritance-based filesystem in my webapp?

I have an app that contains different "skins", and most of these skins share the same images. For each skin, we have been creating a copy of the image directory, just in case one of the files is different. Is there something like object oriented inheritance for an IIS directory? Meaning if a file exists, use it, otherwise pull the file ...

Select distinct file type extensions from all hard drives?

Is there some way to get a distinct list of file extensions on all drives in my system? ...

C#: What is the fastest way to generate a unique filename?

I've seen several suggestions on naming files randomly, including using System.IO.Path.GetRandomFileName() or using a System.Guid and appending a file extension. My question is: What is the fastest way to generate a unique filename? ...

Are there any problems with this symlink traversal code for Windows?

In my efforts to resolve Python issue 1578269, I've been working on trying to resolve the target of a symlink in a robust way. I started by using GetFinalPathNameByHandle as recommended here on stackoverflow and by Microsoft, but it turns out that technique fails when the target is in use (such as with pagefile.sys). So, I've written a ...

How to cache view partial File.exists? checks for life of app in Rails

I'm rendering polymorphic records in a view by looping over the polymorphic records and choosing the appropriate partial to use for the polymorphic relationship. However when a user is administering the site each polymorphic record may (or may not) have a second (alternate) partial that should be used in that situation. So currently I'...

detect new or modified files with python

I'm trying to detect when a new file is created a directory or when an existing file is modified in a directory. I tried searching for a script that would do this (preferably in python or bash) but came up short. My environment is linux with Python 2.6 Related Questions: http://stackoverflow.com/questions/415856/how-to-detect-new-or-m...

InfoPath Form Registration and Case-Sensitive File Path Strangeness: What's going on here?

Recently I had to troubleshoot a very strange issue with a fully-trusted InfoPath 2007 form at a customer site. The form is part of a records management application and users launch the form from within the application. However, because the form is subject to frequent updates, we store a "master" copy of the form file on the customer's...

Test if a directory is a sub directory of another folder

I am trying to create a function that will block access to some of my low level directories. For example, while building my site I don't want to allow uploads to be uploaded any lower than /var/www/html/site/uploads/ should I make a mistake while coding. This will also help to prevent a directory delete typo while removing cache files or...

Are /../ and /./ the only file system symbolic links?

I want to check that a file system path is valid and safe to use relative to another path. So I want to know if there are any other special characters like /../ and /./ which might cause a path to actually point somewhere else. If that is all I have to worry about then a quick replace of those chars followed by something like this to ch...

Millions of small graphics files and how to overcome slow file system access on XP

Hi, I'm rendering millions of tiles which will be displayed as an overlay on Google Maps. The files are created by GMapCreator from the Centre for Advanced Spatial Analysis at University College London. The application renders files in to a single folder at a time, in some cases I need to create about 4.2 million tiles. Im running it on...

How can I efficiently retrieve the number of files in a directory?

Is there a way (on windows using Delphi 2010) to get the number of files in a dirctory without actually traversing all files? I want to implement a progress bar during some file system indexing operation. For that reason I need to know how many files are in the directory. What is the fastest way to get the number of files in a director...

Find a path in Windows relative to another

This problem should be a no-brainer, but I haven't yet been able to nail it. I need a function that takes two parameters, each a file path, relative or absolute, and returns a filepath which is the first path (target) resolved relative to the second path (start). The resolved path may be relative to the current directory or may be absol...

PHP: why would file_put_contents() succeed but touch() fail?

I'm running a script that makes some changes to the contents of a file then resets its modification time to what it was before. Intermittently, I'll find the following errors in my log: touch() [function.touch]: Utime failed: Operation not permitted This on the line immediately after a file_put_contents() call appears to have c...

Get SYSTEM temp folder?

I'm looking for something similar to this question. However, I am looking specifically to dynamically find the location of the system's temp folder (i.e. the temp folder used by services.) Is this possible? Thanks, ...

How do I compare timestamps of files in a DOS batch script?

In DOS batch files, the method of achieving certain things is somewhat obfuscated. Fortunately, there is a fantastic reference site for DOS batch scripting: Simon Sheppard's SS64. (The same site also has plenty of information about Bash.) One difficulty is branching execution based on whether a directory is empty. The obvious if exist "...

How to query the filesystem (NTFS) with SQLite?

Hi everybody. How can I query the filesystem (NTFS) with SQLite? ...

How to create a directory in Lua ?

Is it possible to create a directory in lua ? If so, how ? ...