filenames

Pitfalls of automated file versioning?

I'm working on a file management system and would like to include an automated versioning such as bates numbering if a file with the same name exists. I thought of inserting a "-v0001" between the filename and extension and counting the number of versions as they come in. $basename = pathinfo($filename, PATHINFO_BASENAME); $fname = pat...

How can I find filenames that do not have a . in them?

How can you find files by the following regex? [^.] The solution may be in the commands: find, perl, ls ...

Getting the used file name from a Properties instance

An instance of java.util.Properties is passed to me which has been created using: [...] properties = new java.util.Properties(); try { properties.load( AutoProperties.class.getClassLoader().getResourceAsStream(propertyFile) ); } [...] I was wondering how I could retrieve the file name (propertyFile above) from the properties ...

rename part of filename

Hello, sorry for the properly stupid question, but I am quite a newbie. I have loads of files which look like this: DET01-ABC-5_50-001.dat ... DET01-ABC-5_50-0025.dat and I want them to look like this: DET01-XYZ-5_50-001.dat ... DET01-XYZ-5_50-0025.dat how can I do this? I tried several things from this forum but I seem to make a...

How to get file name from full path with PHP?

For example,how to get Output.map from F:\Program Files\SSH Communications Security\SSH Secure Shell\Output.map with PHP? ...

Naming and organizing images

What's the general rule of thumb while naming dynamic / user-uploaded images. For instance, profile pictures. Is there a benefit for filenames to be human-readable (joshmason_profile.jpg) and not something random (sjdir2311.jpg)? And how do you organize them? All in a single folder with filenames in database? or dynamically generated f...

Can't filter filenames in Talend Open Studio using regular expressions

Hi to all! This question is about Talend Open Studio code. I use tSendmail component as a child job, that needs to be run when parent job fails (tFtpPut). However, in tFtpPut, file names are filtered by filename masks (for example, it will upload file named Eedoh, if I put Ee* as a mask), but in tSendMail that's not the case. I unders...

Using vim to get filename into files

Hi folks, I have a number of text files (700+) and I need to get each file's name into the start of every line in the file. Example, for filename myfile0072.txt mike 160 jane 174 to myfile0072.txt mike 160 myfile0072.txt jane 174 I don't have access to bash or c or perl or anything at work. Is there something I can do in vi...

get renamed file names of multiple upload form [js array] in codeigniter

Hi friends, I use codeigniter. I have a multiple image upload form. The code below is working well for uploading, but I also need to save file names to database. How can I get the names in here? I spent hours & hours :/ but could not sort it :/ Appreciate helps!!! uploadform.php echo form_open_multipart('gallery/upload'); <inpu...

Formula/pattern to provide a unique 32 bit int that represents a 512 character file path?

Is there a common formula that could provide a unique value for a 512 character file path, assuming one 32 bit byte per character, and possibly limiting the characters used in the names? I know that if you just used uppercase letters alone the combination would be grossly more than a 32-bit int, but what about using an identity field wi...

What Perl module(s) do I use to obtain an absolute path (including filename) from a relative one on Windows?

I can only imagine I'm not searching correctly; this seems like an obvious question to be asked here. My apologies if this is a duplicate. I'm writing a Perl program that will take a filename as a command-line argument. I need to convert the filename (or the filename with a relative path attached) to an absolute path (specifically to wo...

C# - Append Number To File Being Saved

I have created a screenshot program and all is working great. The only problem is, I am not sure how I can make it so the screenshots are saved with appending numbers. Example: Screenshot 1, Screenshot 2, Screenshot 3, Screenshot 4, etc. Obviously this could be applied to other files being saved. Any ideas? Thank you. ...

Correct C++ code file extension? .cc vs .cpp

I have seen C++ code live in both .cc and .cpp files. Which of these (or another!) is the best practice/most modern/best to use? http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml seems to suggest .cc, are there any other opinions or options? I am mainly concerned with programs on Linux systems. =:) ...

Java Can't Open a File with Surrogate Unicode Values in the Filename?

I'm dealing with code that does various IO operations with files, and I want to make it able to deal with international filenames. I'm working on a Mac with Java 1.5, and if a filename contains Unicode characters that require surrogates, the JVM can't seem to locate the file. For example, my test file is: "草鷗外.gif" which gets broken int...

Reading a file name from piped command

So I'm trying to get the C program to read a filename from the command line in the following format: cat (filename path) | (program name) i can get it to read the name of the input file when its entered as a command line argument, but it won't read from the concatenated argument here's the code, right now its reading the name of the fi...

file name with special characters like "é" NOT FOUND

I have a folder on my website just for random files. I used php opendir to list all the files so i can style the page a bit. But the files that I uploaded with special characters in them don't work. when i click on them it says the files are not found. but when i check the directory, the files are there. seems like the links are wrong. a...

file_exists() for a file that contains (&) in filename

$filename = "Sara & I.mp3"; if (file_exists($filename)) { ... } If the filename has a "&" PHP does not return true for file_exists How can I escape "&" in the $filename for the file_exists to work? Already tried urlecode(), urlrawencode(), htmlentities(), and escaping the '&' with a backslash (\&)... no go ps. this is on a linux sy...

print entire directory of text files to printer with filename as header using bash or openoffice basic script

I want to print an entire directory of text files to a printer inserting the file name at the top of the first page of each file that is printed. A bash or openoffice script would serve me well. Thanks ...

Bash globbing - autoexpand for a few specific cases?

I understand that the wildcard * (by itself) will expand in such a way that it means "all non-hidden files in the current folder" with hidden files being those prefixed by a period. There are two use cases that I would think are useful, but I don't know how to properly do: How can you glob for... "All files in the current folder, incl...

TFS rollback when user deleted file and created new one with same name

Someone (other than myself) accidentally deleted files in TFS and checked it in. He then discovered his error and wanted to replace the lost files, which he did - from his own hard drive. In between his error and my discovery of it, others have made changes to adjacent files. Now, I want to roll the deleted files back to their state befo...