I'm trying to write a static member function in C# or find one in the .NET Framework that will re-case a file path to what the filesystem specifies.
Example:
string filepath = @"C:\temp.txt";
filepath = FileUtility.RecaseFilepath(filepath);
// filepath = C:\Temp.TXT
// Where the real fully qualified filepath in the NTFS volume is C:\T...
A customer is complaining that our code used to write files with Japanese characters in the filename but no longer works in all cases. We have always just used good old char * strings to represent filenames, so it came as a bit of a shock to me that it ever worked, and we haven't done anything I am aware of that should have made it stop...
I have a portion of a bash script that is getting a filename without extension, but I'm trying to understand what is really going on here. What are the "%%"'s for? Can someone elaborate on what bash is doing behind the scenes? How can this technique be used on a general basis?
#!/bin/bash
for src in *.tif
do
txt=${src%%.*}
...
Is there a function to extract the extension from a filename?
Thanks all! That's what I needed!
...
I am using jQuery to call PHP files via the $.get method
function fetchDepartment(company_id)
{
$.get("ajax/fetchDepartment.php?sec=departments&company_id="+company_id, function(data){
$("#department_id").html(data);
});
}
What I am thinking is can I secure the filename even further?
Currently I have a global access c...
On windows, I'm trying to acquire the file name using the %~f1 parameter.
I'm doing this from a new voice (command) which I've added to the contextual menu.
In the windows registry, the voice simply calls a batch script which prints the file name,
by this way:
`C:\script.bat %~f1`
but I get this output:
`C:\Documents and Setting...
I would like to translate a Perl package name to the full path of the file.
say package_name_to_path('Foo::Bar::Baz');
/tmp/Foo/Bar/Baz.pm
I know there is a CPAN module to do this? I just can't find it again?
...
I've got a string like "Foo: Bar" that I want to use as a filename, but on Windows the ":" char isn't allowed in a filename.
Is there a method that will turn "Foo: Bar" into something like "Foo- Bar"?
...
I want to use GNUMake to run a rule-based makefile which builds a set of C files in a directory structure (on a Windows file system).
The root directory, some sub-directories and some files contain spaces.
Example file: "C:\Documents and Settings\<username>\My Documents\Test Dir\Build Me.c"
GNUMake doesn't really work when the file pa...
I'm trying to create a process that renames all my filenames to Camel/Capital Case. The closest I have to getting there is this:
perl -i.bak -ple 's/\b([a-z])/\u$1/g;' *.txt # or similar .extension.
Which seems to create a backup file (which I'll remove when it's verified this does what I want); but instead of renaming the file, it re...
I decide write a program that list all of the files and directories, but have a problem when dealing with non-english filename.
The problem is that my program cannot gurantee those directories and filenames are in English, if some filenames using japanese, chinese character it will display some character like '?'.
J2SE provide variety ...
To open a file in vim, I usually type ":e " and then hit tab until the file I want appears.
However, I always get in a rhythm and inadvertently go ONE past the desired file. Without knowing how to move backwards, I end up tabbing all the way to the end and repeating the whole process.
Is there a way to perform the filename completion ...
I have some files on my Unix machine that start with
--
e.g. --testings.html
If I try to remove it I get the following error:
cb0$ rm --testings.html
rm: illegal option -- -
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
I tried
rm "--testings.html" || rm '--testings.html'
but nothing works.
How can I remove such...
I'd thought i do a regex replace
Regex r = new Regex("[0-9]");
return r.Replace(sz, "#");
on a file named aa514a3a.4s5 . It works exactly as i expect. It replaces all the numbers including the numbers in the ext. How do i make it NOT replace the numbers in the ext. I tried numerous regex strings but i am beginning to think that its...
I'm creating a class to store a filename. To do so, I need to know exactly which characters are invalid and exactly which characters are invalid as leading/trailing characters.
Windows Explorer trims leading and trailing white-space characters automatically when naming a file, so I need to trim the same characters when constructing a f...
How would I write a function in Python to determine if a list of filenames matches a given pattern and which files are missing from that pattern? For example:
Input ->
KUMAR.3.txt
KUMAR.4.txt
KUMAR.6.txt
KUMAR.7.txt
KUMAR.9.txt
KUMAR.10.txt
KUMAR.11.txt
KUMAR.13.txt
KUMAR.15.txt
KUMAR.16.txt
Desired Output-->
KUMAR.5.txt
KUMAR.8.txt
KU...
I have a problem where I can't write files with accents in the file name on Solaris.
Given following code
public static void main(String[] args) {
System.out.println("Charset = "+ Charset.defaultCharset().toString());
System.out.println("testéörtkuoë");
FileWriter fw = null;
try {
fw = new FileWriter("testéörtk...
I have a document library that is successfully receiving and saving attachments from inbound emails. The problem is that it is taking my nice, mixed-case file names and converting them to all lower case. I have looked on the Internet for a solution and only found a bunch of "me too" people with the same issue. Is there any way to control...
Hi there,
I'm trying to use coldfusion to send out emails containing attachements stored on our server.
To manage these attachments we call them 1.jpg, 2.doc, ... n.ext ... where n is a key in a database where we hold other information about the file such as it's original filename.
I can use the code
<cfmailparam file="c:\path\1.doc"...
I have small utility that does some processing on a file and changes the file extension to .processed when it is finished. I also want to delete these old .processed files after "x" number of days. Is there a file attribute that tells you when a filename was last changed? I realize that I can add white space to the end of the file after...