Top "File" questions

A block of arbitrary information, or resource for storing information, accessible by the string-based name or path.

PHP: How to check if image file exists?

I need to see if a specific image exists on my cdn. I've tried the following and it doesn't work: …

php image file file-io
How to copy a file from one directory to another using PHP?

Say I've got a file test.php in foo directory as well as bar. How can I replace bar/test.…

php file file-io copy filesystems
How to check whether a file is empty or not?

I have a text file. How can I check whether it's empty or not?

python file file-length
How to write into a file in PHP?

I have this script on one free PHP-supporting server: <html> <body> <?php $file = fopen("lidn.…

php file
How do I find files that do not contain a given string pattern?

How do I find out the files in the current directory which do not contain the word foo (using grep)?

file grep directory find
How to declare a structure in a header that is to be used by multiple files in c?

If I have a source.c file with a struct: struct a { int i; struct b { int j; } }; How can …

c file header structure
Better way to check if a Path is a File or a Directory?

I am processing a TreeView of directories and files. A user can select either a file or a directory and …

c# .net file path directory
Pythonic way to check if a file exists?

Which is the preferred way to check if a file exists and if not create it?

python file
Rename multiple files based on pattern in Unix

There are multiple files in a directory that begin with prefix fgh, for example: fghfilea fghfileb fghfilec I want to …

file unix rename batch-rename
logger configuration to log to file and print to stdout

I'm using Python's logging module to log some debug strings to a file which works pretty well. Now in addition, …

python file logging stdout