ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Archives - All » MQ Visual Edit backup queue to file with colon in name

This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.
 MQ Visual Edit backup queue to file with colon in name « View previous topic :: View next topic » 
Author Message
dogbert64
PostPosted: Wed Jun 13, 2007 5:19 am    Post subject: MQ Visual Edit backup queue to file with colon in name Reply with quote

Acolyte

Joined: 11 Jun 2003
Posts: 58

Recently I tried to backup the contents of a queue using MQ Visual Edit 1.4.0. I have done it successfully before but this time I (inadvertantly) put a Colon in the file name. A Colon is not legal in a file name on Windows.

While MQ Visual Edit said it backed the queue up successfully, when I looked at the file, it had a length of 0 and the file name after and including the Colon was truncated. What it probably should have done is tell me that the Colon was invalid.

This was done on a Windows XP, sp2 box.

This is the first issue I've seen in MQ Visual Edit. I like it tremendously. It has same me much time and hassle.

Not griping, just wanted to make someone aware of what I found.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed Jun 13, 2007 8:43 am    Post subject: Re: MQ Visual Edit backup queue to file with colon in name Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
Location: London, ON Canada

dogbert64 wrote:
I have done it successfully before but this time I (inadvertantly) put a Colon in the file name. A Colon is not legal in a file name on Windows.

While MQ Visual Edit said it backed the queue up successfully, when I looked at the file, it had a length of 0 and the file name after and including the Colon was truncated. What it probably should have done is tell me that the Colon was invalid.

Hi,

I did a test and yes, that's exactly what happens. So I figured that MQVE is not catching a thrown exception. But after going through the code with the debugger, I found that the JVM was not throwing any exceptions. The JVM is actually writing it out to a file (I don't know where it is but it exists).

The funny part is you can do a 'Restore Queue' function in MQVE and give the exact file name including the colon and the file will be loaded!!!!

Even weirder, from a command prompt, if you type
Code:
notepad test3:333.txt

This command will open notepad and allow you to edit file 'test3:333.txt' and even save it. Of course, this makes absolutely no sense. If you look in the directory all you see is 'test3' file with a zero length. Now from the command prompt, reopen that same named file and you will see your contents!!!!!

I haven't a clue as to where Windows is storing the file or partial file name on the hard drive. I have searched and searched and cannot find where it put it.

Therefore, this isn't a MQVE or Java problem but a Windows problem because if Windows does not support a colon in the file name then it should generate an error.

Isn't Windows a wonderful OS!!! I guess I'll need to add code to catch a colon in a file name that Windows doesn't like.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Wed Jun 13, 2007 9:02 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Heh.

NTFS has a special type of file - an "attribute" (or somesuch), that is referenced by "filename:attributename".

It's basically a metadata file, that is always moved and copied along with the real file. So what is going on is, all the data is going into the metadata file, and the base file is being created as an empty file.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed Jun 13, 2007 9:10 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
Location: London, ON Canada

jefflowrey wrote:
NTFS has a special type of file - an "attribute" (or somesuch), that is referenced by "filename:attributename".

It's basically a metadata file, that is always moved and copied along with the real file. So what is going on is, all the data is going into the metadata file, and the base file is being created as an empty file.

Really.

So, if I delete the 'test3' file with zero length then the metadata is deleted too? Is there an easy way to see if a file has a metadata file?

Can this be prevented?

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Wed Jun 13, 2007 9:15 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I don't remember if there's an easy way to see if a file has associated metadata files...

I once wrote a C utility that showed these for a given base file, but I had to use the Win32 *backup* utilities in order to get a list of them - the regular directory listing functions DO NOT return these metadata file names.

I can't conceive of how to do this in Java without going to JNI.

Also, yes, the associated metadata files get deleted when you delete the base file.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
dogbert64
PostPosted: Wed Jun 13, 2007 9:17 am    Post subject: Reply with quote

Acolyte

Joined: 11 Jun 2003
Posts: 58

This site may have a utility which can handle that:


http://www.microsoft.com/technet/sysinternals/systeminformationutilities.mspx

http://www.microsoft.com/technet/sysinternals/FileAndDisk/NtfsInfo.mspx
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed Jun 13, 2007 9:46 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
Location: London, ON Canada

Hi,

See you learn something new everyday. Bits of information that I wish I didn't have to learn but never-the-less, I learnt some new today.

I'll put a general file name check into MQVE to not allow a colon in the path & file name except for column 2.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies. Page 1 of 1

MQSeries.net Forum Index » Archives - All » MQ Visual Edit backup queue to file with colon in name
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.