[%TAGS (074db819ec% %074db819ec) %]
(074db819ec% IF user.email && action == 'arc' %074db819ec)
(074db819ec% END %074db819ec)
- From: PILCH Hartmut phm@a2e.de
- Subject: [Patents] EPO patent on pathname conversion
- Date: Mon, 6 Nov 2000 22:50:20 +0100 (CET)
EP0800142
Method and apparatus for path name format conversion
SUN MICROSYSTEMS INC (US)
Claims
1. A method encoded in the form of binary program instructions for
converting an ASCII path name having a prefix and a file name to a
parsed path name structure, said method implemented in conjunction
with a computing system, said computing system having a random access
memory (4) for storing the program instructions, for providing buffers
in which to store data to be manipulated in accordance with the
program instructions, as well as intermediate and final program
results, and a central processing unit (CPU) (3) for manipulating the
data in accordance with the program instructions in order to achieve
the intermediate and final program results, said method comprising the
steps of:
(a) providing for assigning a buffer (21, 31) within the random access
memory in which the parsed path name structure will be assembled;
(b) providing for converting at least a portion of the ASCII path name
to an unparsed string (22A, 32A) of corresponding unicode values, and
sequentially writing said unparsed string, character by character,
into said buffer (21, 31); and
(c) providing for converting the unparsed string to the parsed path
name structure (22B, 32B).
2. The method of Claim 1, which further comprises the step of
providing for defining a parsed path name structure as a string of
unicode values, said string having a first unicode value which
represents a first number which specifies a length, in bytes, of said
string, said string having a first array of unicode values which
represent said prefix, said first array being followed by a second
array of unicode values which represent the file name, said first
unicode value being followed by a second unicode value which
represents a second number which specifies a length, in bytes, of said
prefix plus four bytes which account for said first and second unicode
values, said second unicode value being followed by a third unicode
value which represents a number which specifies a length, in bytes of
a first element of said prefix, any other element of said prefix and
said file name each being preceded by a corresponding byte length
specifying unicode value.
3. The method of Claim 1, which further comprises the step of
providing for determining whether or not the ASCII path name follows a
Uniform Naming Convention (UNC):
an ASCII path name which does not follow said UNC beginning with a
drive specifier character followed, respectively, by a colon
character, a prefix beginning with a single backslash character, and a
file name beginning with another single backslash character;
an ASCII path name which follows said UNC beginning with a pair of
adjacent backslash characters followed, respectively, by a host name,
a shared name which begins with a single backslash character, a prefix
which begins with another single backslash character, and a file name
which begins with still another single backslash character.
4. The method of Claim 3,
wherein, for ASCII path names which do not follow said UNC, each
character of the ASCII path name is converted to the unparsed string
(21A) of unicode values; and
wherein, for ASCII path names which follow said UNC, two extra unicode
values are written at the beginning of the buffer, and only the prefix
and the file name are converted to a string of unicode values which
are placed immediately adjacent said two extra values, and wherein
said two extra values and the values corresponding to said prefix and
said file name comprise the unparsed string (31A) of unicode values.
5. The method of Claim 4, wherein conversion of the unparsed string of
unicode values (21A, 31A) to a parsed path name structure (22B, 32B)
comprises the steps of:
(a) providing for determining a number T, which represents a total
number of unicode character values in said string beginning with a
first character of said string and ending with a unicode value which
represents a last character of the file name;
(b) providing for replacing said first unicode value of said string
with a unicode value equivalent to 2T, which will specify a length for
said parsed path name structure in bytes;
(c) providing for determining a number P, which represents a total
number of unicode values which represent said prefix;
(d) providing for replacing a second unicode value of the unparsed
string with a unicode value equivalent to 2P, which specifies a length
for said prefix in bytes.
6. The method of Claim 5, which further comprises the step of
providing for determining the length of all unicode array elements of
which said prefix is comprised and replacing a backslash character
which begins each array element within said prefix with a unicode
value which specifies a length for that element.
7. The method of Claim 3,
wherein, for ASCII path names which do not follow said UNC, each
character of the ASCII path name is converted to the unparsed string
(21A) of unicode values; and
wherein, for ASCII path names which follow said UNC, only two
characters preceding the prefix, the prefix, and the file name are
converted to the unparsed string (31A) of unicode values.
8. The method of Claim 7, wherein conversion of the unparsed string of
unicode values (21A, 31A) to a parsed path name structure (22B, 32B)
comprises the steps of:
(a) providing for determining a number T, which represents a total
number of unicode character values in said string beginning with a
first character of said string and ending with a unicode value which
represents a last character of the file name;
(b) providing for replacing said first unicode value of said string
with a unicode value equivalent to 2T, which will specify a length for
said parsed path name structure in bytes;
(c) providing for determining a number P, which represents a total
number of unicode values which represent said prefix;
(d) providing for replacing a second unicode value of the unparsed
string with a unicode value equivalent to 2P, which specifies a length
for said prefix in bytes.
9. The method of Claim 7, which further comprises the step of
providing for determining the length of all unicode array elements of
which said prefix is comprised and replacing a backslash character
which begins each array element within said prefix with a unicode
value which specifies a length for that element.
10. A computer program storage medium encoding a program of
instructions for a process which converts an ASCII path name, said
ASCII path name having both a prefix and a file name, said prefix
comprising at least one name element, to a parsed path name structure,
said instructions being readable and executable by a computer system,
said process comprising the steps of:
(a) providing for loading a first buffer (21, 31) with an ASCII path
name;
(b) providing for determining whether or not said ASCII path name
conforms to a Uniform Naming Convention (UNC), a UNC path name having
a shared name preceding said prefix, a host name preceding said shared
name, and a pair of backslash characters preceding said host name, for
a non-UNC path name, said prefix being preceded by a colon character,
said colon character being preceded by a drive specifier character;
(c) providing for establishing a second buffer within which a parsed
path name structure (22B, 32B) corresponding to the ASCII path name
will be assembled;
(d) providing for sequentially scanning the ASCII path name, character
code value by character code value, beginning with either the first
code value of a non-UNC ASCII path name, or a second code value
immediately preceding the prefix of a UNC name;
(e) providing for converting each character code value of the ASCII
path name as it is scanned to a unicode value;
(f) providing for sequentially writing each unicode value to memory
locations within said second buffer as the conversion proceeds to
create an unparsed string (22A, 32A) of unicode values having first
and last unicode values;
(h) providing for writing a null unicode value to the second buffer
immediately following said last unicode value of the unparsed string;
(i) providing for pointing to said first unicode value of said
unparsed string with a first pointer, said first unicode character
being a unicode value farthest from unicode characters corresponding
to said file name;
(j) providing for scanning said second buffer with a second pointer in
a direction from the first pointer toward the null character, stopping
when the pointer is set to the null character, counting the total
number, T+1, of unicode values within the unparsed string, including
the null character;
(k) providing for moving said second pointer toward said first pointer
one unicode value, so that said second pointer points at a unicode
value corresponding the last character of said file name, subtracting
"1", which represents this one character pointer shift, from the
number T+1, and multiplying the result by 2;
(l) providing for scanning said unicode string with a third pointer
beginning with the unicode value pointed at by the second pointer and
in a direction toward said first pointer, stopping said third pointer
on a first backslash unicode value, and counting a number of
characters, F, including said first backslash unicode value;
(m) providing for determining a number, P, which represents a length,
in bytes, of said prefix, by subtracting F from T and multiplying the
result by 2;
(n) providing for replacing said first backslash unicode value with a
unicode value equivalent to the number F;
(o) providing for repeatedly scanning with said third pointer toward
said first pointer until encountering each intervening backslash
unicode value, replacing each encountered backslash unicode value with
a unicode value corresponding to a quantity of unicode values counted
since the previous backslash, and multiplying the result by "2";
(p) providing for replacing said first unicode value with a unicode
value equivalent to the number 2T; and
(q) providing for replacing a unicode value at a second memory
position with said second buffer, said second position being adjacent
said first unicode value, with a unicode value equivalent to the
number 2P.
11. A computer-implemented process for converting an ASCII path name
to a parsed path name structure (22B, 32B), said ASCII path name
having a filename and prefix, said prefix comprising at least one path
element, said process comprising the steps of:
(a) providing for loading a first buffer with an ASCII name;
(b) providing for determining whether or not said ASCII path name
conforms to a Uniform Naming Convention (UNC), a UNC path name having
a shared name preceding said prefix, a host name preceding said shared
name, and a pair of backslash characters preceding said host name, for
a non-UNC path name, said prefix being preceded by a colon character,
said colon character being preceded by a drive specifier character;
(c) providing for establishing a second buffer within which a parsed
path name structure (22B, 32B) corresponding to said ASCII path name
will be assembled;
(d) providing for sequentially scanning the ASCII path name character
by character, beginning with a first character of said ASCII path name
if a non-UNC name and beginning with two characters preceding said
prefix if a UNC name;
(e) providing for converting each character of said ASCII path name as
it is scanned to a unicode value:
(f) providing for sequentially writing each unicode value to said
second buffer as the conversion proceeds, thus creating an unparsed
string (22A, 32A) of unicode values, said unparsed string having
first, second, and last unicode values, as well as intervening unicode
values between said second and last unicode values, said first unicode
value being most distant from said file name;
(g) providing for appending a null unicode character value to said
second buffer immediately following said last unicode value;
(h) providing for determining a quantity 2T equivalent to the total,
in bytes, of said unicode character string, and replacing said first
unicode value with another unicode value corresponding to the quantity
2T;
(i) providing for determining a quantity 2P equivalent to a length of
said prefix in bytes, and replacing said second unicode value with yet
another unicode value corresponding to the quantity 2P; and
(j) providing for determining a quantity 2F corresponding to a length,
in bytes, of the unicode characters corresponding to said file name,
and replacing a unicode value corresponding to a backslash character
at the beginning of said file name with a unicode value corresponding
to 2F; and
(k) providing for determining a unicode value corresponding to a
length, in bytes, for any subelement of said prefix and replacing a
unicode value corresponding to a backslash character at the beginning
of such element with a unicode value corresponding to the length of
such element.
12. The method of Claim 10, wherein total unicode string length T is
determined by the steps of:
(a) providing for pointing to said first unicode value with a first
pointer;
(b) providing for scanning said unparsed string with a second pointer
in a direction from said first unicode value to said null character
value, counting a total number, T+1, of unicode characters, including
the null character;
(c) providing for moving said second pointer toward the first pointer
one unicode value, so that said second pointer points at said last
unicode value, subtracting "1", which represents this one character
move, from T+1, and doubling the result.
13. The method of Claim 10, wherein prefix length 2P, in bytes is
determined by the steps of:
(a) providing for scanning with a third pointer beginning with a
unicode value pointed at by said second pointer and in a direction
toward said first pointer, stopping said third pointer on a unicode
value corresponding to a first backslash character encountered, and
counting a number of characters, F, including said first backslash
character; and
(b) providing for calculating the quantity, 2P, which represents
prefix length in bytes, by subtracting F from T and doubling the
result.
14. A computer implemented method for converting an ASCII path name to
a parsed path name structure (22B, 32B), said ASCII path name having
file name and prefix elements, said prefix element having at least one
subelement, said process comprising the steps of:
(a) providing for defining a parsed path structure;
(b) providing for allocating buffers for stack variables;
(c) providing for creating a plurality of pointers for scanning and
counting functions;
(d) providing for determining whether or not Uniform Naming Convention
is used for the ASCII path name;
(e) providing for converting the ASCII code to an unparsed string of
unicode values (21A, 31A), and writing the unparsed string to a
buffer;
(f) providing for employing the scanning and counting functions, in
addition to mathematical and replacement functions to convert a first
pair of buffer locations to unicode values which are indicative of
total string length and prefix length, respectively, and to convert
each unicode value corresponding to a backslash character within said
unicode string to a specific unicode values, each of which identifies
a length, in bytes, associated with a path element which began with
the replaced backslash character unicode value.
15. A computer program product comprising:
a computer usable medium having computer readable code embodied
therein for converting an ASCII path name to a parsed path name
structure, the computer program product comprising:
computer readable program code devices configured to cause a computer
to effect defining a parsed path structure;
computer readable program code devices configured to cause a computer
to effect allocating buffers for stack variables;
computer readable program code devices configured to cause a computer
to effect creating a plurality of pointers for scanning and counting
functions;
computer readable program code devices configured to cause a computer
to effect determining whether or not Uniform Naming Convention is used
for the ASCII path name;
computer readable program code devices configured to cause a computer
to effect converting the ASCII code to an unparsed unicode string
having first, second, last and intervening unicode values, and writing
said unparsed string to a buffer; and
computer readable program code devices configured to cause a computer
to effect employing the scanning and counting functions, in addition
to mathematical and replacement functions to convert said first and
second unicode values to new unicode values which are indicative of
total string length and prefix length, respectively,and to convert
each unicode value corresponding to a backslash character within said
unicode string to a specific unicode values, each of which identifies
a length, in bytes, associated with a path element which began with
the replaced backslash character unicode value.
16. A computer program product comprising:
a computer usable medium having computer readable code embodied
therein for converting an ASCII path name to a parsed path name
structure, the computer program product comprising:
(a) computer readable program code devices configured to cause a
computer to effect providing the assignment of a buffer within a
random access memory in which the parsed path name structure will be
assembled;
(b) computer readable program code devices configured to cause a
computer to effect providing for converting at least a portion of the
ASCII path name to an unparsed string of unicode values, and
sequentially writing said unparsed string, character by character,
into said buffer; and
(c) computer readable program code devices configured to cause a
computer to effect providing for converting said unparsed string to
the parsed path name structure.
17. The computer program product of Claim 15, which further comprises
computer readable program code devices configured to cause a computer
to effect providing for defining a parsed path name structure as a
unicode character string having a defined format.
_________________________________________________________________
Data supplied from the esp@cenet database - l2
- [Patents] EPO patent on pathname conversion, PILCH Hartmut phm
(074db819ec%|loc%074db819ec)Archive powered by(074db819ec%END%074db819ec) MhonArc 2.6.16.
(074db819ec%TAGS [% %]%074db819ec)