Sam,
The characters you used in your example are all valid in an IFS path
name. They may not be supported by all file systems, but they are
supported by SOME file systems, and by the IFS as a whole.
For example, I could do this from CL:
EDTF STMF('"/home/klemscot/Bob: Hello? <hangs up>"')
That will create a file named 'Bob: Hello? <hangs up>' in the
/home/klemscot directory of my root file system of the IFS.
Likewise, I can use these filenames from QShell:
QSH CMD('cat '/home/klemscot/Bob: Hello? <hangs up>')
The fact that you want to display it from a .NET app changes the rules
significantly, because now you'll have to follow the rules of Windows
Network or HTTP, or whatever file access method you've chosen to use to
display the file. And I'm not a .NET person, so I can't help you with
that.
But, in general, your question is a lot more complex than meets the eye!
IFS supports about a dozen different file systems, and they all have
different rules. And in some of them (like root or QOpenSys), there
really are no rules, you can do whatever you want. Then even if it's a
valid path name, your application can still fail to open it due to
security -- the user might not have permission to use that directory.
Or it might be a legal filename, but specifies a directory that doesn't
exist, in which case it's a perfectly valid filename, but would fail to
open unless you created the directory first.
Personally, I think your best bet for verifying the file name is to try
opening the file... if it successfully opens, then you have a valid
pathname at least as far as the IFS is concerned. If you end up
creating a file that didn't previously exist, your code could
potentially be smart enough to delete it. But this way you know it's
valid, passes security, and references a directory that does exist.
It's just much simpler that way.
On 1/28/2010 6:36 PM, Lennon_s_j@xxxxxxxxxxx wrote:
I want to be sure that if the called program tries to create a file with
the path and file name that it won't fail. The resultant file will be a
PDF that will be redisplayed in a browser using a .NET app. Thus I have
the feeling that there are certain characters that can't be used, for
example ?, :,<,>.
As an Amazon Associate we earn from qualifying purchases.