[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: classpath/java/io File.java
From: |
Mark Wielaard |
Subject: |
Re: classpath/java/io File.java |
Date: |
20 Jul 2003 00:40:22 +0200 |
Hi,
On Sat, 2003-07-19 at 14:36, Torsten Rupp wrote:
> Modified files:
> java/io : File.java
>
> Log message:
> canWrite(): set prefix for temporary file to "tmp" to make methode
> usable on
> systems with DOS-style filesystems (8+3-limitation)
This makes sense since it makes us more usable even on some file
systems.
> createTempFile(): limit length of filename from temporary file to
> 8-length(prefix) to make methode usuable on systems with DOS-style
> filesystems (8+3-limitation)
// Now process the prefix and suffix.
if (prefix.length () < 3)
- throw new IllegalArgumentException ("Prefix too short: " +
prefix);
+ throw new IllegalArgumentException ("Prefix too short: " +
prefix + "(valid length 3..7)");
+ if (prefix.length() >= 8)
+ throw new IllegalArgumentException("Prefix too long: " + prefix
+ "(valid length 3..7)");
But is this really necessary on "normal" systems?
My java class libraries book says that the prefix and suffix may be
shortened to produce a valid filename on the underlying system.
But this actually prevents using a long (descriptive) prefix even on
systems that allow them. Is there documentation or behavior with other
systems that mandate this? If not then I think you should revert this
part and find a way to properly truncate the prefix on systems that need
it.
Thanks,
Mark