filesystem

How to upload a file in SYmfony 1.2 without using a specific form

I haven't done much file uploading in Symfony to this point and I'm trying to figure out how to do it in 1.2+ I can get the files submitted to the action and retrieve them via: $files = $request->getFiles(); How can I get then save the file to the file system? I don't see any documentation besides the old 1.0 depreciated code. It l...

How to perform security check on a given path (from web server) to serve files

Hello, I need to write a small file serving component for web server. There are lots of issues serving files. Because "as-is" serving as big security hole, like this www.somesite.com/../../../../etc/passwd There are many issues including ".." resolving and many others like under windows there are many "unusual ways to refer to some pa...

How can I write my own 'filesystem' within Windows?

I've recalled using little 'filesystems' before that basically provided an interface to something else. For example, I believe there was a GMail filesystem that created an entry in My Computer and could be used like any other drive on your local computer. How can I go about implementing something like this in C++? Thank you! ...

"short read" from filesystem, when can it happen?

It is obvious that in general the read(2) system call can return less bytes than what was asked to be read. However, quite a few programs assume that when working with a local files, read(2) never returns less than what was asked (unless the file is shorter, of course). So, my question is: on Linux, in which cases can read(2) return les...

A filesystem-based compression cache -- does this exist?

Hi. I'm looking for a program with really quite specific functionality, which hopefully exists so I don't have to implement it myself. I can best describe this hypothetical program as a filesystem-based cache of compressed copies of documents in the working directory. I've made a mock-up of what I would expect this program to do: jam...

enabling users to modify documents stored by an application

Hi, we have the following scenario: * a .NET application allows users to upload documents. * the documents are stored in a filesystem, currently inaccessible to users. the path is basically \year\month\day\filename.ext * the path and filename are stored in a database (MS SQL200) that is used to link the documents to various records in th...

how to limiting downloading file system via browser only through my web application

I need the best way to prevent any access to doc files when it is not my web application, for example, I need some files to be hidden from search engines or public users and only private users may reach and download them. I would like to save the files in the file system and not in the DB in order not to increase the DB usage. ...

Bulletproof method for listing folders in a specific directory (PHP 4 compatible)

I have a need for a simple function that lists all folders (non-recursive) in a given directory. The directory will always be the same (the images folder of my theme directory). I've been using the function below, but it fails when the PHP version is < 5. I suppose I could wrap the function in a PHP version check. I'm just trying to ma...

How to get an array of all sub directories for a specified path?

For example, I have a directory structure like this: my_stuff classes one two more evenmore manymore subsub subsubsub otherstuff morestuff deepstuff toomuch and I want to add everything (!) under...

make mac package/bundle programmatically.

through terminal you can make it with a command - "SetFile -a B filename" programmatically i think i should set one of the attributes through [[NSFileManager defaultManager] createDirectoryAtPath:dirPath withIntermediateDirectories:NO attributes:attributes error:nil]; but i can't find witch one. thanks) ...

How to acess ctime, mtime, … of a symbolic link?

On unix symlinks are pointers to another file. Not only the file but also the symlink has a ctime, mtime, …. I know the symlinks time can be accessed, as ls displays it. If I use one of ruby's File#ctime, File#mtime, …, I always get the attribute of the file the symlink is pointing to, not of the symlink. How can I read this values in ru...

Rich Filesystem

My company downloads numerous files on a daily basis via ftp. Currently these files are stored in a fairly large file hierarchy, which is cumbersome to navigate. In addition the files often have meaningless names making them difficult to identify. We are considering building an application that presents a rich "filesystem" to the user...

Android: is it possible to add ZIP file as a raw resource and read it with ZipFile?

Is it possible to add ZIP file to APK package as a raw resource and read it with ZipFile class? It looks like it's trivial to open file from SD card, but not from APK. ...

How to recursively traverse directories in C on Windows

Ultimately I want to travel through a folder's files and subdirectories and write something to all files i find that have a certain extension(.wav in my case). when looping how do i tell if the item I am at is a directory? ...

iPhone NSURL String/HTML Local App Resource Accessed in Another Application

Using iPhone SDK: 3.0 (Firmware 3.1.2) I'm new to iPhone development and researched here and google for a few hours with no luck. Here's the issue: I have an ebook in epub format that I want to sell on the app store, but the app store requirement is that the epub must be contained in an iphone app. So, I decided to make an app that ...

Storing images in file system, amazon-s3 datastores

There has been numerous discussions related to storing images (or binary data) in the database or file system (Refer: http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay) We have decided to use the file system for storing images and relevant image specific metadata in the database itself in the short term and migrat...

How do I exclude a folder when performing file operations i.e. cp, mv, rm and chown etc. in Linix

How do you exclude a folder when performing file operations i.e. cp etc. I would currently use the wild card * to apply file operation to all, but I need to exclude one single folder. The command I'm actually wanting to use is chown to change the owner of all the files in a directory but I need to exclude one sub directory. ...

AT&T Synaptic Storage as a Service access using Linux

I'm looking for an open source library or project which would offer a filesystem or block device representation for AT&T Synaptic Storage as a Service. I'm looking for something similar to what you have for Amazon S3 : s3backer, s3fs-fuse, s3fs, or FuseOverAmazon. Unfortunatly, I didn't find anything like that for AT&T's storage offeri...

Pseudo filesystems on *nix

I need some opinions pointers on creating pseudo-filesystems for linux/*nix systems. Firstly when I say pseudo-filesystem I mean something like /proc where the structure within does not represent actual files on disks or such but the state of the kernel. I would like to try something similar as an interface to an application. As an exa...

How to check if a dir exists in C

Hey guys, I'm relatively new to C, so forgive me if this is a stupid question, but how would I go about checking if a FILE is a directory? I have if (file == NULL) { fprintf(stderr, "%s: No such file\n", argv[1]); return 1; } and that checks if the node exists at all, but I want to know if it's a dir or a file. I've d...