473,606 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

win32api.FindFi les Win2003, problem with Short Name

I'm having a problem retrieving the ShortName from a file that was
written by a MAC and only from a Windows 2003 server.

I realize the file has a space after it, but I can retrieve the short
name from Windows XP and 2000;
print win32api.FindFi les(process_sou rce_dir + "*")


Excluding the results from "." and "..", it returns:
(32, <PyTime:10/13/2005 8:12:12 PM>, <PyTime:10/13/2005 8:41:40 PM>,
<PyTime:10/13/2005 8:16:56 PM>, 0, 44118, 29741111, 0, '10^2f16
Hardcover a ', '10^2F167.5AC') - All OK!!

When using the same command on Win2003, it returns:
<PyTime:10/13/2005 8:49:06 PM>, <PyTime:10/13/2005 8:16:56 PM>, 0,
44118, 29741111, 0, '10^2f16 Hardcover a ', '')

The versions of Python / Win32 are the same on all servers.
Does anyone have any ideas?

Frank

Oct 13 '05 #1
5 3115
Frank Borell:
I'm having a problem retrieving the ShortName from a file that was
written by a MAC and only from a Windows 2003 server.

I realize the file has a space after it, but I can retrieve the short
name from Windows XP and 2000;


Does your Windows 2003 machine have short file name support turned
off? The NtfsDisable8dot 3NameCreation registry option is popular with
some administrators.

Neil
Oct 14 '05 #2
Neil,

On all three types of PC/Servers they are set to 0.

For now I'll have to process this script on non 2003 servers?!?

Thanks,

Frank

Oct 14 '05 #3
Frank Borell:
On all three types of PC/Servers they are set to 0.

For now I'll have to process this script on non 2003 servers?!?


What do you get if you call win32api.GetSho rtPathName on the long name?

Neil
Oct 15 '05 #4

Neil Hodgson wrote:
Frank Borell:
On all three types of PC/Servers they are set to 0.

For now I'll have to process this script on non 2003 servers?!?


What do you get if you call win32api.GetSho rtPathName on the long name?

Neil


Neil,

It seems I'm in a catch 22.

My initial issue was trying to rename/move files on a SAN that were
written from Mac's. While the easier messed up files names were easy to
convert and move, I quickly came across a few types that were not.
Files with spaces at the end seemed to only be solved with the
win32api.FindFi les(fullpath + '*').

The catch 22:
All other commands reported the path structure but the output could not
be used because Python/the system reported that it could not find the
file/path specified. (Including GetShortName).

Unfortunately I've been testing on an XP with all working fine, the
Win2003 simply does not show anything on the SAN for FindFiles(last
tuple).

It DOES show shortnames for other directories like 'c:/python24/lib'

Win2003 on ''c:/python24/lib'

Original Name | Short Name

aifc.py|
anydbm.py|
asynchat.py|
asyncore.py|
atexit.py|
atexit.pyc|
audiodev.py|
base64.py|
base64.pyc|
BaseHTTPServer. py|BASEHT~1.PY
Bastion.py|
WinXP on SAN:

Original Name | Short Name

^2aCOSBY SON PROFILE^2fNYT18 |A^2ACOSB.1A7
Jimmy Carter|JIMMY_CF .86A
Allende's Last Day-jpgd.|ALLENDEC. 9D3
archives 1959|ARCHIVE6.3 30
Barbara Jordan|BARBARAF .714
Bettmann-Mine 24.6mgs|BETTMAN 7.D79
Bosley Crowther 16-095.jpg|BOSLEY_ F.148
Calvin Klein.jpg|CALVI N_5.0B1
Carl Erskine Bkyln Dodger.jpg|CARL _ER8.683

Win2003 on SAN:

Original Name | Short Name

A^2aCOSBY SON PROFILE^2fNYT18 |
Jimmy Carter|
Allende's Last Day-jpgd.|
archives 1959|
Barbara Jordan|
Bettmann-Mine 24.6mgs|
Bosley Crowther 16-095.jpg|
Calvin Klein.jpg|
Carl Erskine Bkyln Dodger.jpg|
Chess^2fConrad|
Coco Chanel portrait 18-940.jpg|
Coco Chanel1 18-940.jpg|
Frank

Oct 17 '05 #5
Frank Borell:
My initial issue was trying to rename/move files on a SAN that were
written from Mac's.
I've never used a SAN. It is possible that it has its own name
system and what you are seeing is the result of different views of that.
While the easier messed up files names were easy to
convert and move, I quickly came across a few types that were not.
Files with spaces at the end seemed to only be solved with the
win32api.FindFi les(fullpath + '*').
Does performing a dir /X from the command line show the short names
from the 2003 system? If so it means that there are APIs capable of
finding the information so I'd be trying to use ctypes to call the
underlying wide character FindFirstFileEx W function.
^2aCOSBY SON PROFILE^2fNYT18 |A^2ACOSB.1A7


This was hex escaped from *COSBY SON PROFILE/NYT18.

Neil
Oct 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
48190
by: Matt Smith | last post by:
hi all, again.... having another problem with python COMs, I run a python script on a win2000 machine, that uses win32com.client and it runs perfectly, whereas when I come to run it on a win98 machine (the machine that the code, when completed, will be running from in the future) it returns the error: Traceback (most recent call last): File "firsttry.py", line 1, in ?
5
7395
by: Gary Richardson | last post by:
I'm trying to use win32api.SetCursorPos() to position the cursor in a Tkinter canvas window. I.e.: from Tkinter import * import win32api root = Tk() canvas = Canvas(root, width=400, height=300, bg='white') canvas.pack() win32api.SetCursorPos(100,100) root.mainloop()
1
5514
by: xytho33 | last post by:
I need to be able to programatically get the version info from a windows DLL preferably in the same format as what is displayed in the properties tab. I was overjoyed to find Mark Hammond's Python Extensions (http://starship.python.net/crew/mhammond/) The package includes a little demo program "filevers.py" distributed in the win32api download that does exactly what I need. Unfortunately I get this error when I execute the script:
2
2520
by: xytho33 | last post by:
I need to be able to programatically get the version info from a windows DLL preferably in the same format as what is displayed in the properties tab. I was overjoyed to find Mark Hammond's Python Extensions (http://starship.python.net/crew/mhammond/) The package includes a little demo program "filevers.py" distributed in the win32api download that does exactly what I need. Unfortunately I get this error when I execute the script:
1
4876
by: Jody Gelowitz | last post by:
We are having an issue in that when trying to read a file that is on Server2 from Server1 (through our ASP.NET project), we receive the error: Access to the path "\\Server2\MyShare\MyFile.tif" is denied. Here is the server setup that we have: Dev - Development Computer on WinXP Pro SP2 (IIS5), VS2003 developing under .NET Framework 1.1 Server1 - Web Server on Win2003 Server (IIS6) Server2 - File Server on Win2003 Server
6
1552
by: ian | last post by:
Hi, I keep resorting to com interop calls, for example I needed the location of the carot in a text box and I had to use a win32API call (GetCarotPos??) to do that. It's one example, I could give several more that have come up over the last few months, and it has raised a couple of questions the answers to which could plug a few holes in my knowledge. First, I'm uncomfortable using API calls purely because I don't fully understand the...
0
3809
by: Mike | last post by:
Hi. I have Python 2.4 installed on my local machine in c:\Python24. I have also downloaded the python for windows extensions installer pywin32-208.win32-py2.4.exe and installed this to C:\Python24\Lib\site-packages Trying to run a python script through a C# console app is causing me problems: the last line of code in the following block results in a no module named win32ap error. I'm not sure if this is because there is no
2
1492
by: Don Rich | last post by:
Please share with me any ideas you may have for troubleshooting and resolving the subject problem. I can give more details as necessary. (Please advise if I should post this problem to a more specific group.) Here's the situation in a nutshell. We're using WinXP Pro workstations configured to a common standard on a nation-wide intra-network and we recently migrated one operation involving networking with a WinNT server (with...
1
2819
by: Michiel Overtoom | last post by:
On Saturday 19 July 2008 21:13:04 Lamonte Harris wrote: What are the actions you do and the commands you give, and what is the precise error you get? Greetings, -- "The ability of the OSS process to collect and harness
0
8010
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8429
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8084
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6761
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3922
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3969
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1550
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.