in reply to Wrong idioms
You've noticed a problem, but are proposing the wrong solution.
The author wasn't being lazy, but overzealous.
The better solution is to simply skip the check of the filename completely.
Pass the filename supplied to the open function and let it detect and report the error.
This approach is portable because it lets the OS decide whether the string passed is valid.
The alternative is for every file handling routine to detect the current OS and then replicate all of the complex rules for filenames and paths for all systems; and that is a nonsense.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Wrong idioms (open $fh, '<', undef)
by Anonymous Monk on Mar 29, 2013 at 23:59 UTC | |
by BrowserUk (Patriarch) on Mar 30, 2013 at 01:57 UTC | |
by Anonymous Monk on Mar 30, 2013 at 02:39 UTC | |
by BrowserUk (Patriarch) on Mar 30, 2013 at 02:45 UTC | |
by Anonymous Monk on Mar 30, 2013 at 02:46 UTC | |
| |
by vsespb (Chaplain) on Mar 30, 2013 at 00:38 UTC | |
by Anonymous Monk on Mar 30, 2013 at 02:40 UTC | |
by vsespb (Chaplain) on Mar 30, 2013 at 09:04 UTC | |
by Anonymous Monk on Apr 02, 2013 at 08:38 UTC | |
| |
|
Re^2: Wrong idioms
by vsespb (Chaplain) on Mar 30, 2013 at 00:16 UTC |