I'm trying to convince fellow developers to not include $ in file names but couldn't come up any argument other than some Perl scripts may need to be updated. Any suggestions?
A quick glance at Wikipedia's Filename page reveals that only zOS and Commodore DOS disallow the user of $ appearing in certain file names. I can see why you would have trouble coming up with a reason not to use them.
Related
When am trying to open any .EXE file am getting information in encoded form. Any idea how to see the content of an .EXE file ????
I need to know what Database tables are used in the particular .EXE.
Ah, now we are getting closer to the real question.
It is probably much more productive to ask the targeted databases about the SQL queries being execute during the run, or a top-ten shortly afterwards.
The table-names might not be hard-coded recognizably as such in the executable.
They might be obtained by a lookup, and some fun pre-fixing or other transformation might be in place.
Admittedly they like are clear text.
Easiest is probably to just transfer to a Unix server and use STRINGS on the image.
I want to include the source here with but that failed, and I cannot find how to attach a file. Below you'll find a link OpenVMS macro program source for a STRINGS like tool. Not sure how long the link will survive.
Just read for instructions, save (strings.mar), compile ($ MACRO strings), link ($link strings), and activate ($ mcr sys$login:strings image_to_test.exe)
OpenVMS Macro String program text
Good luck!
Hein
Use analyze/image to view the contents of an executable image file.
I'm guessing you are trying to look in the EXE because you do not have access to the source. I do something like this:
$ dump/record/byte/hex/out=a.a myexe.exe
Then look at a.a with any text editor (132 columns). The linker groups string literals together, and they are mostly near the beginning of the EXE, so you don't have to look to far into the file. Of course this only helps if the database references are string literals.
The string literal might be broken across a block (512 byte) boundary, so if you use search in your editor, try looking for substrings.
Aksh - you are chasing your tail on this one. Its a false dawn. Even if you could (and you can't) find the database tables, you will need the source of the .exe to do anything sensible with it, or the problem you are trying to solve. Its possible to write a program which just lists all the tables in a database without reading any of 'em. So you could spend and awful lot of effort and get nowhere. Hope this helps
I'm always forgetting to read man pages for unix commands during my work as a developer. I don't like the clunky man page interface and it's hard to get to the parts I need like a useful example of how to use the command.
Is there a better way? My chosen IDE is PHPStorm in case that is relevant to your answer. My daily OS is OSX 10.8.5
You can pipe | the output of a command (Like a man page) to your IDE. I use Sublime, so for me, to read the man page for ls, I would do...
man ls | sublime
If for some reason your IDE can't do that, you can just write the output to a .txt file and read it there using any of the "write" operators. Here's an example of those.
I've installed apache2 and ColdFusion 9 on an Ubuntu 12.04 box. I've already use the CheckSpelling mod in Apache to disable case-sensitive URLs and other paths that Apache is responsible for.
Now, keep in mind, I'm working with about 4GB of legacy code (about 6 years worth) and very little is up to convention. The coders before me were not concerned with case sensitivity, seeing as how the application was hosted on a Windows Box. For the most part, ColdFusion is behaving with <cfinclude> and CreateObject, but it seems like <cfinvoke> (which is used quite often in the codebase) is still case sensitive.
Now, I've tried the method of moving the code onto a vfat partition, but what I ran into was a whole bunch of encoding issues with filenames (we deal with foreign companies and get a lot of special characters). Deleting and/or renaming the files would be cumbersome, as most are also referred to in the MySQL database, and would have to be modified there as well. So recoding is somewhat of a nightmare.
So, I'm curious if ColdFusion has any special flags when running on Linux to be case insensitive, or if there is another method for making this all come together?
EDIT
I'm Sorry, I was mistaken. cfinvoke seems to work ok. I'm choking on cfobject
I did some research, and this is what I came up with...
Creating Custom Tags (help.adobe.com)
Note: Although tag names in ColdFusion pages are not case sensitive, custom tag filenames must be lowercase on UNIX.
cfinvoke Documentation (help.adobe.com)
On UNIX systems, ColdFusion searches first for a file with a name that matches the specified component name, but is all lower case. If it does not find the file, it looks for a file name that matches the component name exactly, with the identical character casing.
Since <cfinvoke> is a standard tag, the tag itself is case-insensitive. However, it sounds like all component argument(s) to <cfinvoke> need to have a lower-case filenames in order for calls with irregular casing to succeed consistently. I know you said refactoring is difficult, but this is what I've come up with:
If you have a folder where you specifically keep components, it's trivial to run a shell script in that folder that renames them all to have lower-casing (remove -i if you don't want to be asked if you're sure each time):
for filename in *.cfc; do
lowercase =`echo $filename | tr '[:upper:]' '[:lower:]'`
mv -i $filename $lowercase
done
If you don't have the components all in the same folder, try it from the top directory.
Let me know if you were able to give this a shot!
I currently have a directory with 98,000 individual archive transaction files. I need to search those files for user input strings and have the option to open the files as it finds them or at the end of the search. I'm using Notepad++ currently and, while functional, it's quite slow. I thought about writing my own, but I am only familiar with .NET and I'm a beginner. Also, I'm not sure how efficient that would be compared to NP++.
This tool would be used again and again so the dev time would definitely be worth it if it came to that. Is there some other tool out there that's already developed that would accomplish this?
Agent Ransack
I've been using it for years.
I recommend you using Astrogrep, a grep utility for Windows. You can open files as it finds them, and it shows you the line where the match was found, without having to open the file.
Assuming the archive transaction files are plain text, you can download CYGWIN which is an environment providing UNIX tools for Windows.
Once that's done, you can open a new Cygwin Bash Shell, then do cd 'c:\\foo' to get into the directory with your files, then do grep -F -r "my string" * to find your text. (The -F means it searches for that literal string as opposed to a regular expression and -r means recursive.)
Possibly overkill, but you could index the folder using Lucene, keep the index uptodate (as transaction files are added) and then searches will take trivial amounts of time, you can target the file, line and word number of each match for a given search string
I have a DCL script on VMS which calls a perl script. Is there a VMS/DCL command I can use that will tell me every file handle opened by the perl script?
Set default to the disk the app runs from (or you might have to try each disk in succession if it's a really large or distributed app). Then the command is
show device/files/nosystem
If you're on a more recent version of VMS and the lists are too long, you can pipe it with a search by doing this:
pipe show device/files/nosystem | search sys$input (name of perl script)
You need to find the documentation for undocumented VMS features :-)
Seriously I think that set watch might do what you want. If you issue
$ set watch file/class=(all,nodump)
$ perl yourperlscript.pl
You will get loads of output that will hopefully include what you want. I havent done it for years, you probably tune the options to fine tune it. See
http://www.parsec.com/openvms/undocumented.php?page=13
Jason, I need more clarification for a). Are you saying that you want to run your perl script in a batch file and have the batch file monitor the files being accessed by the perl script? Or something else?
Hmm, not sure about that. Maybe add a linux tag to your post so that some linux people can see this and chime in. I'm not sure why your perl program wouldn't know what files it opened. It's your program, wouldn't it access the files you told it to access? Or if you're computing the filenames somehow (which I've done in cobol, but still know at least which directory to find them in, and what naming scheme they use), you'd still have clues like what I mention. Also, since it's your program, and if you're computing the filenames, coudn't you also make your Perl program output it's own little report of what the files were? Like, just after it computes the filename, have it copy the name string to a separate report file.