title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white. As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green. |
|
Wednesday, August 07, 2002 | |
Where's the blog been? Well, I've been busy so the blog's not. But I thought I'd share the kind of thing I'm having to deal with in my busy days. I'm copying files from one place to another in VB 6, where that other place is determined by the user. Simple enough, and here's the code to take the original file (and there are many so I'm doing this as generic as possible. I'm cycling through the files collection with the FileSystemObject and recursively calling the sub when I hit a folder) and get the new file position: strNewFile = Replace(fileItem.Path, strOldPath, strNewPath) Here's the glitch. On Windows NT, 2k, and XP, we're happy as pigs in mud. On Windows 98, we end up blasting the original file. Quick, first person to get the answer gets a quarter! That's right, I'm pulling the path from an actual File object, and in Windows 98 a file's path, due to some DOS interaction, I imagine, has capital letters all over. When I try to replace, I'm doing a binary replace by default, and that makes "a" (97 decimal) and "A" (65 decimal) very different. Here's some evidence from the Immediate Window in VB 6: ? Replace("first", "FIR", "tree") first ? Replace("first", "FIR", "tree", , , vbTextCompare) treest For heaven's sake. Note that I'm not upset with the Replace function -- it does great. But I am a little put off by Windows 98's integration with its file system. The user interface and the plumbing underneath just don't do well together. Note that, since I didn't make myself clear above, that the Windows UI (eg, the File Explorer) displays these file names with lowercase letters. So a file like, "C:\camelNotation\anotherCamel\fileName.txt" comes up as "C:\CAMELNOTATION\ANOTHERCAMEL\fileName.txt" with the File object for some reason that must be related to MS's plan to lay Win32 over legacy DOS code. Put that together with the fact that I just "won" a laptop at eBay that will have a hard time running anything other than Windows 95 (thought it'd be a fun VB test box)... but that's another blog. "The myth of the $100 laptop." I think you can see where I'm headed. :^) posted by ruffin at 8/07/2002 05:39:00 PM |
|
| |
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
![]() |
|
|