× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.