Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I had a different Perl issue on Windows a while back and what I found that helped me might end up helping you out.

In my situation, I was trying to deal with very long paths. In Windows, there are two file system APIs. One of the APIs (used by file explorer and the command prompt) is limited to a max of 250-256 characters (I've seen different reference material with differing values) and that limitation is in place for backwards compatibility. The other API allows for use of the full capabilities of NTFS, which are significantly longer path support as well as Unicode support. Although you might not be hitting the path length issue, the Unicode support may be an issue for your code.

The module that I found that gave access to the second API is Win32::LongPath, which provides replacement functions that uses "Windows wide-character functions which support Unicode and extended-length paths". In your case, you would import Win32::LongPath into your code change your -e $path to be testL ('e', $path) instead. (See the documentation on the testL function for the list of other -x file tests that it can replace.)

Also, if you are dealing with files that have Unicode in the filenames, you may have issues with other file related tasks, such as opening the file for reading/writing or file stat tasks. The Win32::LongPath module probably should have other functions to help provide you with a work around solution.


In reply to Re: Perl on Windows: file names with accented characters, UTF-8 and -e by dasgar
in thread Perl on Windows: file names with accented characters, UTF-8 and -e by bart

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-25 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found