filenames

bash filename start matching

Hello, I've got a simple enough question, but no guidance yet through the forums or bash. The question is as follows: I want to add a prefix string to each filename in a directory that matches *.h or *.cpp. HOWEVER, if the prefix has already been applied to the filename, do NOT apply it again. Why the following doesn't work is somethi...

checking filename

How can i check if filename contains some string? for example if "frody" contains "ro"? I tried like that: if (file_name.Contains("ro")== true) and: if (file_name.Contains("ro")) ...

Lucene .NET fixed filenames in index directory possible?

When building a Lucene .NET index it creates several randomly named files under the root index directory. My question is, is there a way to have these files have a static or fixed name and just overwrite upon re-index, or all be in one file? ...

does utf-8 encoding messes file globbing and grep'ing?

I'm playing with bash, experiencing with utf-8 encoding. I'm new to unicode. The following command (well, their output) surprises me : $ locale LANG="fr_FR.UTF-8" LC_COLLATE="fr_FR.UTF-8" LC_CTYPE="fr_FR.UTF-8" LC_MESSAGES="fr_FR.UTF-8" LC_MONETARY="fr_FR.UTF-8" LC_NUMERIC="fr_FR.UTF-8" LC_TIME="fr_FR.UTF-8" LC_ALL= ...

How does the length of a filename affect remaining storage space on a disk?

How does the length of a filename affect remaining storage space on a disk? I realize this is filesystem dependent. In particular I am thinking about the EXT series of file systems. I don't fully understand how inodes affect disk space and how the filename itself is stored. It's difficult to get relevant search results for this question...

Is there any way to validate a filename?

I figured this has to be in the RTL somewhere, but I looked and I can't find it. function IsValidFilename(filename: string): boolean; //returns True if it would be possible to create or open a file with //this name, without modifying the current directory structure In other words, it has to point to an existing folder on a valid local...

A way to use RegEx to find a set of filenames paths in a string

Good morning guys Is there a good way to use regular expression in C# in order to find all filenames and their paths within a string variable? For example, if you have this string: string s = @"Hello John these are the files you have to send us today: <file>C:\Development\Projects 2010\Accounting\file20101130.csv</file>, <file>C:\Dev...

Issues in log4net with dynamic filenaming in RollingFileAppender

I have 3 appenders in my config file for creating 3 different types of logs. I am using dynamic naming of file in each of the 3 appenders by setting the global context properties. In some cases, i need to set the log file name dynamically for just 1 appender. When i set the file name for just 1 appender, it creates another file named "nu...

How do I remove a specific extension from files recursively using a bash script

I'm trying to find a bash script that will recursively look for files with a .bx extension, and remove this extension. The filenames are in no particular format (some are hidden files with "." prefix, some have spaces in the name, etc.), and not all files have this extension. I'm not sure how to find each file with the .bx extension (i...

Change the executable name in Eclipse for C++

I've created a C++ project in Eclipse and currently it builds an executable called file.exe but I want to change this to "file". How do I do this? Thanks. ...

How can I write consecutive named files in Java?

I have a method for saving a File, but I don't know how to save files with consecutive names such as file001.txt, file002.txt, file003.txt, filennn.text How can I achieve this? ...

How to sanitize user created filenames for a networked application?

I'm working on an instant messaging app, where users can receive files from their friends. The names of the files received are set by the sender of the file, and multiple files can be sent together with the possibility of subdirectories. For example, two files sent together might be "1" and "sub/2" such that the downloaded results shoul...

How can I correct the path of a file to be OS specific in Perl?

Due to some messed up legacy code, I have $path = [OS specific base DIR name][hardcoded Linux file path] So on Linux, it is something like $path = /common/path/to/dir/pathtofile/name.extension but on Windows it becomes this $path = C:\path\to\dir\pathtofile/name.extension Some of the code fails on Windows because it is expectin...

Dot in file name?

Is it okay to use a "." (dot) in file names instead of camelcase or dashes etc.. for example: ico_active.user.png Will it cause any performance or browser compatibility issues or some other disadvantage? Thanks! ...

Base64 Encoding safe for filenames?

Is Base64 encoding safe to use for filenames on windows and linux systems? From my research I have found replacing all "/" characters of the output string with "-" or "_" should resolve any issues. Can anyone provide more details on this? Currently in Java I am using the following peice of code: MessageDigest md5Digest = MessageDi...

Add suffix to file name before extension

What's the simplest way to add a suffix to a file name before the extension in Objective-C? Example Original name: image.png Suffix: ~ipad Result: image~ipad.png ...

Apache, PHP: send filename through $_GET

Hello, I'm having an upload Java applet to handle large files upload. The use of this upload is mandatory, so dropping it is not an option. The problem is that, after the upload, the applet redirects to a given url and sends some info through $_GET. I can't change that ( the sending method, the params order ). And the last param sent is...

What is the correct way to join multiple path components into a single complete path in emacs lisp?

Suppose I have variables dir and file containing strings representing a directory and a filename, respectively . What is the proper way in emacs lisp to join them into a full path to the file? For example, if dir is "/usr/bin" and file is "ls", then I want "/usr/bin/ls". But if instead dir is "/usr/bin/", I still want the same thing, wi...

how to create file names from a number plus a suffix in python

hello. how to create file names from a number plus a suffix??. for example I am using two programs in python script for work in a server, the first creates a file x and the second uses the x file, the problem is that this file can not overwrite. no matter what name is generated from the first program. the second program of be taken e...

File name encoding at Knoppix

I am getting file list in my Java program using list() method of File class. When I run my program on Knoppix I get ???? instead of Cyrillic file names. It seems that problem is in knoppix, not java. I tried to use options for mounting file system, such as nls and iocharset, but it has no effect (or may be I use it in wrong way). Somebod...