Sign in to follow this  
Followers 0
goldenix

[Solved] Fileopen problem

10 posts in this topic

#1 ·  Posted (edited)

Hi

Hire is the thing.

I want to lock a file. The problem is that, the name of the file is in russian and or japanese. And it returns -1 error when i try to open it. Is there a way around this? like convert file name into binary or something?

$fileopen = FileOpen(ППППППППП.txt, 0)
ProcessWaitClose('upn.exe')
FileClose($fileopen)
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites



Hi

Hire is the thing.

I want to lock a file. The problem is that, the name of the file is in russian and or japanese. And it returns -1 error when i try to open it. Is there a way around this? like convert file name into binary or something?

$fileopen = FileOpen(ППППППППП.txt, 0)
ProcessWaitClose('upn.exe')
FileClose($fileopen)

How do you even run that without quotation marks around th efilename?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

its a typo.

hire:

$fileopen = FileOpen('ППППППППП.txt', 0) 
ProcessWaitClose('upn.exe') 
FileClose($fileopen)

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

To be able to type the full Unicode character range in litterals, you need to have your source file in "UTF-8 with BOM" encoding. If you use ANSI (your user codepage), you only have access to the restricted part that your codepage defines.

If you use Scite, open your source, then menu File > Encoding > UTF-8 with BOM, make any change to your source (e.g. insert space then remove space) then save it. From now on, your file will use UTF-8 Unicode encoding and you can compose any Unicode character of your choice, even if the font you use is unable to display it.

Try doing that with this example:

Local $str[10] = [ _
 "Sant Julià de Lòria", _
 "Skrýchov u Opařan", _
 "Žíšov", _
 "БОЛЬШОЕ ГРИДИНО", _
 "МЫТИЩИ-ДТИ", _
 "歴史的仮名遣", _
 "変体仮名", _
 " فرنسيّ عربيّ", _
 "सभी मनुष्यों को गौरव और अधिकारों के मामले में जन्मजात स्वतन्त्रता और समानता प्राप्त है। उन्हें बुद्धि और अन्तरात्मा की देन है और परस्पर उन्हें भाईचारे के भाव से बर्ताव करना चाहिये।", _
 "เขาจะได้ไปเที่ยวเมืองลาว" _
]

Again, only rare fonts will be able to display all of this correctly, but the characters are indeed there even if the glyphs are lacking.

Also don't forget that ConsoleWrite will only display ANSI (user codepage) unless special tricks are used. Ask again if you need more information.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

....

I need to lock a file.

But I get error when I try to use Fileopen() cuz the name of the file is not in english.

my *.au3 file is already in UTF

Is there any other way to lock a file?

Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

The only way to lock a file is to have it open in a process. That's how all programs do it.

Share this post


Link to post
Share on other sites

The only way to lock a file is to have it open in a process. That's how all programs do it.

Sry for asking, but what im supposed to o with this code? what is it for?

Global $oObject 
$oObject.Wtf("is this?")

@MvGulik - It seems that im getting C:\?????.dat instead of the correct name of the file after I drop it into gui. thanx for help.


My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I confirm and sure other can vouch for that too, that it's possible to FileOpen() any UTF-8 filename with the current version.

Do you have rights to access this machine / volume / directory / file ?

Now there is still a possibility that "invisible" issues make such operation impossible without peep-hole scrutiny. Read this carefully.

Programmers have their share of obfuscation thru normalization (or lack of it) here.

Edit:

I see your answer right after posting. Nice to see your problem was elsewhere. Follow the link anyway, it could prove useful some day.

BTW, the "code" is a joke, don't pay more attention.

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Sry for asking, but what im supposed to o with this code? what is it for?

Global $oObject 
$oObject.Wtf("is this?")

@MvGulik - It seems that im getting C:\?????.dat instead of the correct name of the file after I drop it into gui. thanx for help.

That code is part of my signature. trancexx posted it and I found it amusing.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0