Given a group of files with the following naming convention:
datetime_restofname.txt
an example of which would be:
200906290700_somewordorphrase.txt
how could I batch change the mtime of the files to match the date and time in the filename?
...
I would like to create a method which takes either a filename as a string or a FileInfo and adds an incremented number to the filename if the file exists. But can't quite wrap my head around how to do this in a good way.
For example, if I have this FileInfo
var file = new FileInfo(@"C:\file.ext");
I would like the method to give me a...
After-the-dot-in-a-file-name, it is called extension.
...
I have a system where a user uploads documents (pdf, word) etc. The problem being, foreign users are uploading filenames in arabic, chinese, japanese and the system, being able to handle them, is adding them to the database.
Where the problem arises is trying to download the files using php:
$result = mysql_query($query) or
die(...
I have the following For loop in a batch file:
for /R c:\test\src %%i IN (*.*) DO (
MOVE %%i C:\test\destination
ECHO %%i
exit
)
The result of the ECHO outputs the entire file path Ex: C:\Foldername\Filename
I need to ECHO out only the Filename.Is there a specific command which would give me the filename ?
Thanks !
...
I have this method for grabbing the file name from a string URI. What can I do to make it more robust?
private string GetFileName(string hrefLink)
{
string[] parts = hrefLink.Split('/');
string fileName = "";
if (parts.Length > 0)
fileName = parts[parts.Length - 1];
else
fileName = hrefLink;
return ...
Hi all,
I have an MDI application that initially doesn't have the main window open. When you click on file and select new, it opens a new tab with the default file name on it.
My application should work like this, when you click on file and select new, a dialog box comes out asking for the name of the file you want to create. After c...
I have a solution where I'm repeating various class names within three different projects (a WCF service project, a unit testing project and a BL project). Also partial classes have been used to spread these classes across multiple files.
The net result is that I've got 5 different file names that are repeated across three different pro...
Is there a quick and dirty mapping of MIME types to extensions in PHP that I can make use of?
...
I'm making a cross-platform application that renames files based on data retrieved online. I'd like to sanitize the Strings I took from a web API for the current platform.
I know that different platforms have different file-name requirements, so I was wondering if there's a cross-platform way to do this?
Edit: On Windows platforms you ...
How can I determine the maximum filename length on a linux box?
Preferred in PHP programming language.
...
I am using a form to upload files to the google app engine and store them in the datastore. l would also like to store the original file name and extension for presentation purposes.
Is there a way of retrieving this data from the post sever side or can it only be gathered client side and sent as separate fields (e.g. http://www.tinyurl...
This is what I used:
for i in `find some -type f -name *.class`
I got:
some/folder/subOne/fileOne.class
some/folder/subOne/fileTwo.class
some/other/sub/file.class
next, I would like to get rid of the "some/" for each value of $i. What command can I use? Do I HAVE to save them into a file first?
Thanks
...
I need to put data in a file since my other function takes a file as input.
How to I create a uniq filename in Erlang?
Something like unix "tempfile", do it exist?
...
I've got files with spaces in their names that are already on my server. I want to rename them with underscores. I've tried putting a slash before the space, and I've tried replacing the space with %20. Still PHP gives me: No such file or directory. Here's my code:
$dir = './';
$dhandle = opendir($dir);
$old_files = array();
if ($dhand...
This is a somewhat subjective question, and not very important in the big scheme of things, but something that yet annoys me regularly. There seems to be no self-evident way to put a timestamp in a file name.
Objective issue is that timestamps in file names should be sortable. But .NET sortable date formats like "s" ("yyyy-MM-ddTHH:mm:...
I have several thousand ebooks that need to be organized on a headless linux server running bash through SSH. All of the ebooks are thankfully named with one of 2 conventions.
AuthorFirstName AuthorLastName - Book Title.pdf
AuthorFirstName AuthorLastName - Book Series #inSeries - Book Title.pdf
i.e.
Andrew Weiner - Changes.pdf
Allan ...
Hi,
I'm using very tricky fighting methods :) to make a string like 'Fi?le*/ Name' safe for using as a file name like 'File_Name'.
I'm sure there is a cocoa way to convert it. And I'm sure the best place to ask is here :)
Thank you!
...
If you run Sticky Note in Windows 7,its process, is called StikyNot.exe. Several other Windows processes keep their process names under 8 letters.
Why do they do that? What is the advantage? Are they just clinging to the past? Or should everybody be publishing 8-letter executables?
...
If I wanted to create a string which is guaranteed not to represent a filename, I could put one of the following characters in it on Windows:
\ / : * ? | < >
e.g.
this-is-a-filename.png
?this-is-not.png
Is there any way to identify a string as 'not possibly a file' on Linux?
...