Comments (26)
Glad to here it, merging the branch into master
from xplorer.
I think this is a problem because it is implemented via the child process (
).Thanks for the report tho, I'll try to fix it
from xplorer.
No, I mean could you please try to pull the utf8_branch and build it from the source (you'll need to install VS C++ tho) and see if it works?
Sorry, but I don't know anything about programming. But if you can make a guide for me, how to build this project, then maybe I can test it.
Ah, I see. However, here's a link to the executable I built, could you please give it a try? https://drive.google.com/file/d/1luqSBsbkD5yE1l-zkI1efB9Tl0HqIuh5/view?usp=sharing
from xplorer.
Wait, what does Cyrillic
mean?
from xplorer.
Wait, what does
Cyrillic
mean?
Russian alphabet
from xplorer.
from xplorer.
hello guys, instead of doing a copy of node-disk-info code why not using package.json to have it as a dependency ?
A lot of bug have been solved and unless you copy the corrected source code again you won't be able to have the fix and you won't be warned that a new version have been released.
Also there is no versioning available in your Lib folder so nobody know if the code has already been fixed in the source or not.
from xplorer.
Yep, I'm fixing it rn. The module had a bug at that time and I decided to copy the code to fix it by myself and also some additional features and forgot about it hehe. I'm fixing it rn, will deliver a fix soon!
from xplorer.
Also, node-disk-info
does not support volumename
parsing, and this error is because volumename
tho...
from xplorer.
Can't find any solutions right now, I tried the GetVolumeInformationA
, marking this issue as help wanted, any PR will be appreciated
from xplorer.
I remember I had to use this to find the encoding used by the PC and return it as a UTF-8 buffer which after I can change for a string.
Have you try to copy node-disk-info
and just add volumename
on it ?
const drives: Drive[] = [];
let buffer = Utils.execute(Constants.WINDOWS_COMMAND);
const cp = Utils.chcp();
let encoding = '';
switch (cp) {
case '65000': // UTF-7
encoding = 'UTF-7';
break;
case '65001': // UTF-8
encoding = 'UTF-8';
break;
default: // Other Encoding
if (/^-?[\d.]+(?:e-?\d+)?$/.test(cp)) {
encoding = 'cp' + cp;
} else {
encoding = cp;
}
}
buffer = iconv.encode(iconv.decode(buffer, encoding),'UTF-8');
const lines = buffer.toString().split('\r\r\n');
On my Japanese PC I can show the volume name in Japanese without trouble.
Filesystem: Removable Disk
Blocks: 8036257792
Used: 20480
Available: 8036237312
Capacity: 0%
Mounted: D:
Name: データ
(this is the output of a modified node-disk-info
example command.
from xplorer.
@Ekristoffe I'm sorry but do you have an example of it?
This time I've tried the latest version of node-disk-info
by installing via yarn
and edit it inside node_modules and what I got on my computer is ???
instead of データ
This is what I've tried
diff --git a/node_modules/node-disk-info/dist/classes/drive.d.ts b/node_modules/node-disk-info/dist/classes/drive.d.ts
index 79e7add..e47c7eb 100644
--- a/node_modules/node-disk-info/dist/classes/drive.d.ts
+++ b/node_modules/node-disk-info/dist/classes/drive.d.ts
@@ -28,6 +28,7 @@ export default class Drive {
* Indicates the mount point of the disk.
*/
private readonly _mounted;
+ private readonly _volumename;
/**
* Constructor for Drive class.
*
@@ -38,7 +39,7 @@ export default class Drive {
* @param {string} capacity Disk capacity.
* @param {string} mounted Indicates the mount point of the disk.
*/
- constructor(filesystem: string, blocks: number, used: number, available: number, capacity: string, mounted: string);
+ constructor(filesystem: string, blocks: number, used: number, available: number, capacity: string, mounted: string, volumename:string);
/**
* Drive filesystem.
*
@@ -75,4 +76,5 @@ export default class Drive {
* @return Gets the mount point of the disk.
*/
get mounted(): string;
+ get volumename(): string;
}
diff --git a/node_modules/node-disk-info/dist/classes/drive.js b/node_modules/node-disk-info/dist/classes/drive.js
index 9d13d32..7f4dcfb 100644
--- a/node_modules/node-disk-info/dist/classes/drive.js
+++ b/node_modules/node-disk-info/dist/classes/drive.js
@@ -16,13 +16,14 @@ var Drive = /** @class */ (function () {
* @param {string} capacity Disk capacity.
* @param {string} mounted Indicates the mount point of the disk.
*/
- function Drive(filesystem, blocks, used, available, capacity, mounted) {
+ function Drive(filesystem, blocks, used, available, capacity, mounted, volumename=null) {
this._filesystem = filesystem;
this._blocks = blocks;
this._used = used;
this._available = available;
this._capacity = capacity;
this._mounted = mounted;
+ this._volumename = volumename
}
Object.defineProperty(Drive.prototype, "filesystem", {
/**
@@ -96,6 +97,18 @@ var Drive = /** @class */ (function () {
enumerable: false,
configurable: true
});
+ Object.defineProperty(Drive.prototype, "volumename", {
+ /**
+ * Indicates the mount point of the disk.
+ *
+ * @return Gets the mount point of the disk.
+ */
+ get: function () {
+ return this._volumename;
+ },
+ enumerable: false,
+ configurable: true
+ });
return Drive;
}());
exports.default = Drive;
diff --git a/node_modules/node-disk-info/dist/platforms/windows.js b/node_modules/node-disk-info/dist/platforms/windows.js
index 303bd1d..6762154 100644
--- a/node_modules/node-disk-info/dist/platforms/windows.js
+++ b/node_modules/node-disk-info/dist/platforms/windows.js
@@ -41,11 +41,13 @@ var Windows = /** @class */ (function () {
}
buffer = iconv_lite_1.default.encode(iconv_lite_1.default.decode(buffer, encoding), 'UTF-8');
var lines = buffer.toString().split('\r\r\n');
+ console.log(lines)
var newDiskIteration = false;
var caption = '';
var description = '';
var freeSpace = 0;
var size = 0;
+ var volumename = ''
lines.forEach(function (value) {
if (value !== '') {
var tokens = value.split('=');
@@ -65,6 +67,9 @@ var Windows = /** @class */ (function () {
case 'Size':
size = isNaN(parseFloat(data)) ? 0 : +data;
break;
+ case 'VolumeName':
+ volumename = data;
+ break;
}
}
else {
@@ -74,7 +79,7 @@ var Windows = /** @class */ (function () {
if (size > 0) {
percent = Math.round((used / size) * 100) + '%';
}
- var d = new drive_1.default(description, size, used, freeSpace, percent, caption);
+ var d = new drive_1.default(description, size, used, freeSpace, percent, caption, volumename);
drives.push(d);
newDiskIteration = false;
caption = '';
diff --git a/node_modules/node-disk-info/dist/utils/constants.js b/node_modules/node-disk-info/dist/utils/constants.js
index d2936e1..52b0d4c 100644
--- a/node_modules/node-disk-info/dist/utils/constants.js
+++ b/node_modules/node-disk-info/dist/utils/constants.js
@@ -10,7 +10,7 @@ var Constants = /** @class */ (function () {
/**
* Command to execute on Windows.
*/
- Constants.WINDOWS_COMMAND = 'wmic logicaldisk get Caption,FreeSpace,Size,VolumeSerialNumber,Description /format:list';
+ Constants.WINDOWS_COMMAND = 'wmic logicaldisk get Caption,FreeSpace,Size,VolumeSerialNumber,Description,VolumeName /format:list';
/**
* Command to execute on Linux.
*/
Also, if you could please support this directly from node-disk-info, it would be much helpful.
Sorry for keep disturbing you.
Thanks and Regards
from xplorer.
Hello I have published my changes on this:
https://github.com/Ekristoffe/node-disk-info/tree/TestName
It is a quick and dirty test so only windows system and the names could be better
from xplorer.
@Ekristoffe It shows ???
too while this is the real name:
Is it because my system is incompatible (but I don't think so, I got an i7 with 32GB of ram)
Or @Nord1cWarr1or could you please give it a try?
from xplorer.
what is the output of the command (in cmd):
chcp
wmic logicaldisk get Caption,VolumeName /format:list
thanks.
from xplorer.
what is the output of the command (in cmd):
chcp
wmic logicaldisk get Caption,VolumeName /format:list
thanks.
chcp
Active code 65001
wmic logicaldisk get Caption,VolumeName /format:list
Caption=C:
VolumeName=Windows 10
Caption=D:
VolumeName=System Reserved
Caption=E:
VolumeName=Program
Caption=F:
VolumeName=Data
Caption=G:
VolumeName=OS
Caption=H:
VolumeName=New Volume
Caption=I:
VolumeName=??
from xplorer.
Indeed your pc can't handle the non latin char it seem (i think it is more a windows problem since linux is always using UTF8) ...
I am interested by @Nord1cWarr1or could you also try the chcp and wmic command ?
from xplorer.
@Ekristoffe, yes.
chcp
Текущая кодовая страница: 866
wmic logicaldisk get Caption,VolumeName /format:list
Caption=C:
VolumeName=
Caption=D:
VolumeName=Зарезервировано системой
Caption=E:
VolumeName=
Caption=F:
VolumeName=
Caption=H:
VolumeName=Новый том
from xplorer.
Hello, The fix should work without any problem as long as windows is using the right codepage.
from xplorer.
Erm, it's probably my computer problem (but I am sure there're many people with the same problem as me),
I think I'll commit the volume name feat here to support those people like @Nord1cWarr1or .
The code will first check if the volumename property is valid (not ???
), if it's valid, the code will display the volumename, otherwise display the filesystem.
Maybe this is the best approach for now.
I'll open a PR for this issue soon later (as soon as I can use my computer), will you be able to help me test(review) it? @Nord1cWarr1or or @Ekristoffe
Thanks and best regards
from xplorer.
I'll open a PR for this issue soon later (as soon as I can use my computer), will you be able to help me test(review) it? @Nord1cWarr1or or @Ekristoffe
Sure. Test build will be at Actions
, right?
from xplorer.
I'll open a PR for this issue soon later (as soon as I can use my computer), will you be able to help me test(review) it? @Nord1cWarr1or or @Ekristoffe
Sure. Test build will be at
Actions
, right?
No, I mean could you please try to pull the utf8_branch
and build it from the source (you'll need to install VS C++ tho) and see if it works?
from xplorer.
I think I have some code for this. Get Git for the cloning process and you know how to build it after that.
$ git clone https://github.com/kimlimjustin/xplorer.git
$ git checkout utf8_branch
Then you can start the build process.
Edit: Works on all OSes, you need the programs basically.
from xplorer.
No, I mean could you please try to pull the utf8_branch and build it from the source (you'll need to install VS C++ tho) and see if it works?
Sorry, but I don't know anything about programming.
But if you can make a guide for me, how to build this project, then maybe I can test it.
from xplorer.
@kimlimjustin I just installed it, and it works as expected.
from xplorer.
fixed via #144
from xplorer.
Related Issues (20)
- Image hover preview is not proper
- NTFS Folder don't appear on windows HOT 10
- Windows 10 - Endless loop & no longer responds when clicking on some folders HOT 11
- No open with option
- Showcase Removal Notice
- Weird ghost window on mouse hover on taskbar HOT 3
- unable to open multiple files at a time also unable to unzip files
- Can't install on Windows 7 SP1 HOT 5
- yarn install failed HOT 7
- Tab hover effect flickers when hover tab title or close button
- Xplorer .AppImage doesn't run on Fedora Linux HOT 10
- App will not close with 'system' frame style on Linux Mint HOT 4
- yarn dev failed HOT 6
- Cannot open xplorer on Ubuntu 22.04 LTS HOT 10
- keep loading on access to WSL2 `/root` while xplorer itself runs on windows
- External drives not showing up in linux
- Unable to spawn a new child process
- `Acrylic` transparency causes extremely slow window dragging HOT 1
- Mouse on the context menu's icon makes submenu disappear
- (xplorer:89494): dbind-WARNING **: 18:40:22.637: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xplorer.