MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / fs_short_path

Function fs_short_path

web/pgadmin/utils/__init__.py:174–189  ·  view source on GitHub ↗

Gets the short path name of a given long path. http://stackoverflow.com/a/23598461/200291

(_path)

Source from the content-addressed store, hash-verified

172 _GetShortPathNameW.restype = wintypes.DWORD
173
174 def fs_short_path(_path):
175 """
176 Gets the short path name of a given long path.
177 http://stackoverflow.com/a/23598461/200291
178 """
179 buf_size = len(_path)
180 while True:
181 res = ctypes.create_unicode_buffer(buf_size)
182 # Note:- _GetShortPathNameW may return empty value
183 # if directory doesn't exist.
184 needed = _GetShortPathNameW(_path, res, buf_size)
185
186 if buf_size >= needed:
187 return res.value
188 else:
189 buf_size += needed
190
191 def document_dir():
192 CSIDL_PERSONAL = 5 # My Documents

Callers 4

config.pyFile · 0.90
get_sql_util_argsFunction · 0.90
get_complete_file_pathFunction · 0.85
short_filepathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected